diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index e02961fb..c4f30f54 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -390,6 +390,21 @@ class IndicesClient(NamespacedClient): params=params, body=body) return data + @query_params() + def exists_template(self, name, params=None): + """ + Return a boolean indicating whether given template exists. + ``_ + + :arg name: The name of the template + """ + try: + self.transport.perform_request('HEAD', _make_path('_template', name), + params=params) + except NotFoundError: + return False + return True + @query_params('flat_settings') def get_template(self, name=None, params=None): """