From 0701693cba570fa97c312d8af6f2a1b61f7a543d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Wed, 8 Jan 2014 20:38:35 +0100 Subject: [PATCH] ok: true has been removed from es responses --- elasticsearch/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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})