elasticsearch Elasticsearch-搜索类型作为主体参数
我有点反对将search_type指定为body参数。作为一个查询参数,它很好用,但在手册中找不到一个将其指定为查询参数的示例elasticsearch Elasticsearch-搜索类型作为主体参数,elasticsearch,elasticsearch,我有点反对将search_type指定为body参数。作为一个查询参数,它很好用,但在手册中找不到一个将其指定为查询参数的示例 POST /index/type/_search { "search_type": {"query_then_fetch"}, "explain": false, "query" : { "query_string": { "default_field": "adress.city",
POST /index/type/_search
{
"search_type": {"query_then_fetch"},
"explain": false,
"query" : {
"query_string": {
"default_field": "adress.city",
"query": "London"
}
}
}
有什么提示吗
Thx不支持从以下位置将搜索类型放入正文: 可以通过在中设置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"
}
}
}'
是,从,在上述[参数]中,搜索类型和请求缓存必须作为查询字符串参数传递
不能在正文内传递。您有{:“query\u then\u fetch”}
,您可能是指{“query\u then\u fetch”}
(不带分号)