Skip to content

Commit

Permalink
Update bulk_index method
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunihiko Kido committed Jun 3, 2015
1 parent 64d98ff commit af65f55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/elasticsearch/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def bulk_index(client, docs, chunk_size=500, **kwargs):
body = "\n".join(bulk_actions) + "\n"
response = client.bulk(body, **kwargs)

if 'items' not in response:
errors.append(response)
return success, errors

for op_type, item in map(methodcaller('popitem'), response['items']):
ok = 200 <= item.get('status', 500) < 300
if not ok:
Expand Down

0 comments on commit af65f55

Please sign in to comment.