Closed
Description
Parallel bulk returns a generator which has to be unpacked.
This thread https://discuss.elastic.co/t/helpers-parallel-bulk-in-python-not-working/39498 explains the solution. It should be included in the docs.
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:
for success, info in parallel_bulk(...):
if not success:
print('A document failed:', info)If you don't care about the results (which by default you don't have to since any error will cause an exception) you can use the consume function from itertools recipes (https://docs.python.org/2/library/itertools.html#recipes 105):
from collections import deque
deque(parallel_bulk(...), maxlen=0)
Metadata
Metadata
Assignees
Labels
No labels