Add docs to template support for _msearch (#17382)

Add docs to template support for _msearch

Relates to #10885
Relates to #15674

* Reference those docs from the rest api spec for _msearch/template support.
This commit is contained in:
Isabel Drost-Fromm 2016-09-13 13:19:25 +02:00 committed by GitHub
parent 7894eba2b3
commit 0e707f241e
2 changed files with 34 additions and 1 deletions

View File

@ -80,3 +80,36 @@ This default is based on the number of data nodes and the default search thread
=== Security
See <<url-access-control>>
[float]
[[template-msearch]]
=== Template support
Much like described in <<search-template>> for the _search resource, _msearch
also provides support for templates. Submit them like follows:
[source,js]
-----------------------------------------------
$ cat requests
{"index" : "main"}
{ "inline" : "{ \"query\": { \"match_{{template}}\": {} } }", "params": { "template": "all" } }
{"index" : "main"}
{ "inline" : "{ \"query\": { \"match_{{template}}\": {} } }", "params": { "template": "all" } }
$ curl -XGET localhost:9200/_msearch/template --data-binary @requests; echo
-----------------------------------------------
for inline templates. Alternatively for stored templates:
[source,js]
-----------------------------------------------
$ cat requests
{"index" : "main"}
{ "template": { "id": "template1" },"params": { "q": "foo" } }
{"index" : "main"}
{ "template": { "id": "template2" },"params": { "q": "bar" } }
$ curl -XGET localhost:9200/_msearch/template --data-binary @requests; echo
----------------------------------------------

View File

@ -1,6 +1,6 @@
{
"msearch_template": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html",
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html",
"methods": ["GET", "POST"],
"url": {
"path": "/_msearch/template",