Skip to content

Commit

Permalink
Add docs to template support for _msearch (#17382)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Isabel Drost-Fromm authored Sep 13, 2016
1 parent 7894eba commit 0e707f2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/reference/search/multi-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------------------------


Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 0e707f2

Please sign in to comment.