gpt4 book ai didi

elasticsearch - Elastic Search 5.6中的嵌套查询兼容性

转载 作者:行者123 更新时间:2023-12-03 00:50:48 27 4
gpt4 key购买 nike

我的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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com