diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 48c54d08..e70acc1e 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -436,6 +436,23 @@ class Elasticsearch(object): params=params, body=body) return data + @query_params() + def search_template(self, index=None, doc_type=None, body=None, params=None): + """ + A query that accepts a query template and a map of key/value pairs to + fill in template parameters. + ``_ + + :arg index: A comma-separated list of index names to search; use `_all` + or empty string to perform the operation on all indices + :arg doc_type: A comma-separated list of document types to search; leave + empty to perform the operation on all types + :arg body: The search definition template and its params + """ + _, data = self.transport.perform_request('GET', _make_path(index, + doc_type, '_search', 'template'), params=params, body=body) + return data + @query_params('_source', '_source_exclude', '_source_include', 'analyze_wildcard', 'analyzer', 'default_operator', 'df', 'fields', 'lenient', 'lowercase_expanded_terms', 'parent', 'preference', 'q',