Added documentation explaining scan and ordering

Thanks drorata for the initial patch and issue
This commit is contained in:
Honza Král
2015-02-12 10:58:20 +01:00
parent 2f9842abed
commit 756298a360
+6
View File
@@ -193,6 +193,12 @@ def scan(client, query=None, scroll='5m', preserve_order=False, **kwargs):
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that
yields all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To
have a standard order in the returned documents (either by score or
explicit sort definition) when scrolling, use ``preserve_order=True``. This
may be an expensive operation and will negate the performance benefits of
using ``scan``.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg scroll: Specify how long a consistent view of the index should be