Helpers.parallel_bulk in Python not working?
学习了:https://discuss.elastic.co/t/helpers-parallel-bulk-in-python-not-working/39498
需要写:
parallel bulk is a generator, meaning it is lazy and won't produce any results until you start consuming them. The proper way to use it is:
parallel_bulk是惰性的;
for success, info in parallel_bulk(...): if not success: print('A document failed:', info)
不这样写真报错呀;
而且必须进行if判断,要不然会输出很多内容;
直接写 a,b = parallel_bulk(...) if not a print(b) 会报一个too many value to unpack 错误;