我在将search_type指定为body参数方面有些挣扎。作为一个很好的查询参数,它可以工作,但是在手册中没有找到将其指定为查询参数的单个示例。
POST /index/type/_search
{
"search_type": {"query_then_fetch"},
"explain": false,
"query" : {
"query_string": {
"default_field": "adress.city",
"query": "London"
}
}
}
有什么提示吗?
谢谢
根据文档,不支持将搜索类型放在正文中:
可以通过在查询字符串中设置search_type参数来配置类型。
因此,您的查询应如下所示:
curl -XGET http://localhost:9200/index/type/_search?search_type=query_then_fetch -d '
{
"explain": false,
"query" : {
"query_string": {
"default_field": "adress.city",
"query": "London"
}
}
}'
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句