diff --git a/elasticsearch/helpers.py b/elasticsearch/helpers.py index e4b27148..b789ca43 100644 --- a/elasticsearch/helpers.py +++ b/elasticsearch/helpers.py @@ -108,7 +108,7 @@ def streaming_bulk(client, actions, chunk_size=500, raise_on_error=False, expand # go through request-reponse pairs and detect failures for op_type, item in map(methodcaller('popitem'), resp['items']): - ok = item.get('ok') + ok = 200 <= item.get('status', 500) < 300 if not ok and raise_on_error: errors.append({op_type: item})