From c2fc5aa18c0099361085069459374d54e7b88ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Thu, 15 Dec 2016 10:21:38 +1100 Subject: [PATCH] Be more explicit with stats_only behavior --- elasticsearch/helpers/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elasticsearch/helpers/__init__.py b/elasticsearch/helpers/__init__.py index 953b644f..869d3fd8 100644 --- a/elasticsearch/helpers/__init__.py +++ b/elasticsearch/helpers/__init__.py @@ -168,7 +168,11 @@ def bulk(client, actions, stats_only=False, **kwargs): a more human friendly interface - it consumes an iterator of actions and sends them to elasticsearch in chunks. It returns a tuple with summary information - number of successfully executed actions and either list of - errors or number of errors if `stats_only` is set to `True`. + errors or number of errors if ``stats_only`` is set to ``True``. Note that + by default we raise a ``BulkIndexError`` when we encounter an error so + options like ``stats_only`` only apply when ``raise_on_error`` is set to + ``False``. + See :func:`~elasticsearch.helpers.streaming_bulk` for more accepted parameters