You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :meth:`~elasticsearch.Elasticsearch.parallel_bulk` api is a wrapper around the :meth:`~elasticsearch.Elasticsearch.bulk` api to provide threading. :meth:`~elasticsearch.Elasticsearch.parallel_bulk` returns a generator which must be consumed to produce results.
97
+
98
+
To see the results use:
99
+
100
+
.. code:: python
101
+
102
+
for success, info in parallel_bulk(...):
103
+
ifnot success:
104
+
print('A document failed:', info)
105
+
106
+
If you don't care about the results, you can use deque from collections:
107
+
108
+
.. code:: python
109
+
110
+
from collections import deque
111
+
deque(parallel_bulk(...), maxlen=0)
112
+
96
113
.. note::
97
114
98
115
When reading raw json strings from a file, you can also pass them in
0 commit comments