From 7c99b451a69918839f847e124ef4c87007588ba9 Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Tue, 16 Jul 2013 14:22:11 +0200 Subject: [PATCH] Added scroll api --- elasticsearch/client/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index cbea404c..d9919b84 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -249,7 +249,6 @@ class Elasticsearch(object): raise return data - @query_params('analyze_wildcard', 'analyzer', 'default_operator', 'df', 'explain', 'fields', 'ignore_indices', 'indices_boost', 'lenient', 'lowercase_expanded_terms', 'offset', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', 'source', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'version') def search(self, index=None, doc_type=None, body=None, params=None): """ @@ -291,6 +290,18 @@ class Elasticsearch(object): status, data = self.transport.perform_request('GET', _make_path(index, doc_type, '_search'), params=params, body=body) return data + @query_params('scroll') + def scroll(self, scroll_id, params=None): + """ + A search request can be scrolled by specifying the scroll parameter. + http://www.elasticsearch.org/guide/reference/api/search/scroll/ + + :arg scroll_id: The scroll ID + :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search + """ + status, data = self.transport.perform_request('GET', _make_path('_search', 'scroll', scroll_id), params=params) + return data + @query_params('consistency', 'parent', 'refresh', 'replication', 'routing', 'timeout', 'version', 'version_type') def delete(self, index, doc_type, id, ignore_missing=False, params=None): """