Remove put_template and get_template endpoints (#803)
In ES 6.0 the search template system has changed over to stored scripts.
This commit is contained in:
committed by
Nick Lang
parent
2619d0fae4
commit
cab17fd449
@@ -1308,34 +1308,6 @@ class Elasticsearch(object):
|
|||||||
return self.transport.perform_request('GET', _make_path('_scripts', id),
|
return self.transport.perform_request('GET', _make_path('_scripts', id),
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params()
|
|
||||||
def put_template(self, id, body, params=None):
|
|
||||||
"""
|
|
||||||
Create a search template.
|
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
|
|
||||||
|
|
||||||
:arg id: Template ID
|
|
||||||
:arg body: The document
|
|
||||||
"""
|
|
||||||
for param in (id, body):
|
|
||||||
if param in SKIP_IN_PATH:
|
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
|
||||||
return self.transport.perform_request('PUT', _make_path('_search',
|
|
||||||
'template', id), params=params, body=body)
|
|
||||||
|
|
||||||
@query_params()
|
|
||||||
def get_template(self, id, params=None):
|
|
||||||
"""
|
|
||||||
Retrieve a search template.
|
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
|
|
||||||
|
|
||||||
:arg id: Template ID
|
|
||||||
"""
|
|
||||||
if id in SKIP_IN_PATH:
|
|
||||||
raise ValueError("Empty value passed for a required argument 'id'.")
|
|
||||||
return self.transport.perform_request('GET', _make_path('_search',
|
|
||||||
'template', id), params=params)
|
|
||||||
|
|
||||||
@query_params()
|
@query_params()
|
||||||
def delete_script(self, id, params=None):
|
def delete_script(self, id, params=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user