【发布时间】:2015-03-20 03:54:32
【问题描述】:
是否可以在多搜索 api (_msearch) 请求中使用已注册的搜索模板? 如果有,怎么做?
我尝试在正文中给出以下查询。
POST /_msearch
{"index":"index1","type":"type1"}
{"template":{"id":"template_1"},"params":{"a":1, "b":2}}
但这会导致错误:
Parse Failure [No parser for element [template]]
我尝试将所有内容包装在查询中:
POST /_msearch
{"index":"index1","type":"type1"}
{"query":{"template":{"id":"template_1"},"params":{"a":1, "b":2}}}
和 POST 到 _msearch/template,但这些也不起作用。
提前致谢
【问题讨论】:
标签: templates search elasticsearch