From ce74828516269dc8e3880ac971a85d336140d799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Fri, 17 Jan 2014 23:28:18 +0100 Subject: [PATCH] Index isn't required for put_warmer any more --- elasticsearch/client/indices.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 774bf514..fae9fd34 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -495,7 +495,7 @@ class IndicesClient(NamespacedClient): return data @query_params('master_timeout') - def put_warmer(self, index, name, body, doc_type=None, params=None): + def put_warmer(self, name, body, index=None, doc_type=None, params=None): """ Create an index warmer to run registered search requests to warm up the index before it is available for search. @@ -509,6 +509,8 @@ class IndicesClient(NamespacedClient): :arg body: The search request definition for the warmer (query, filters, facets, sorting, etc) :arg master_timeout: Specify timeout for connection to master """ + if doc_type and not index: + index = '_all' _, data = self.transport.perform_request('PUT', _make_path(index, doc_type, '_warmer', name), params=params, body=body) return data