我的REST call (POST)中的有效负载低于其有效工作的Elastic search 2.1.1,但ES 5.6.7中没有
{"from":0,"size":5,"sort":[{"releasedDate":{"order":"desc"}}],"query":{"query_string":{"query":{"query":"demo demo*","defaultOperator":"and"}}}}
在ES 5.6.7中,出现以下异常
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[query_string] unknown token [START_OBJECT] after [query]",
"line": 1,
"col": 96
}
],
"type": "parsing_exception",
"reason": "[query_string] unknown token [START_OBJECT] after [query]",
"line": 1,
"col": 96
},
"status": 400
}
任何人都知道为什么有效负载在ES 5.6.7中不起作用?
最佳答案
在ES 5.6.7中,您需要这样编写:
{
"from": 0,
"size": 5,
"sort": [
{
"releasedDate": {
"order": "desc"
}
}
],
"query": {
"query_string": {
"query": "demo demo*",
"default_operator": "and"
}
}
}
查找文档here。
关于elasticsearch - Elastic Search 5.6中的嵌套查询兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53810580/