From 6f7349eec4782729b6215001ae337df3c6181eee Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 11 Dec 2013 16:43:47 -0600 Subject: [PATCH] make Elasticsearch.scroll POST the scroll ID Without this, if you have a large number of indices the `scroll_id` will be very long, and ElasticSearch will return an invalid response. (A urllib3 `ConnectionError` to be precise.) This changes the behavior to POST to the scroll endpoint, which gets around the URL length restriction. --- elasticsearch/client/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 49275165..b3c0700e 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -441,8 +441,8 @@ class Elasticsearch(object): :arg scroll: Specify how long a consistent view of the index should be maintained for scrolled search """ - _, data = self.transport.perform_request('GET', _make_path('_search', 'scroll', scroll_id), - params=params) + _, data = self.transport.perform_request('POST', _make_path('_search', 'scroll'), + params=params, body=scroll_id) return data @query_params()