gpt4 book ai didi

elasticsearch - elasticsearch query_parse_exception意外字符(':'(代码58)):期望逗号分隔数组条目\n

转载 作者:行者123 更新时间:2023-12-02 22:19:39 25 4
gpt4 key购买 nike

我是新手,已经在服务器上安装了es2.3.1,但是当我在网站上阅读《权威指南》时,发现了一个示例,该示例在服务器上出现错误。 Here是链接,错误如下:

{
"error" : {
"root_cause" : [ {
"type" : "query_parsing_exception",
"reason" : "Failed to parse",
"index" : "megacorp"
} ],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [ {
"shard" : 0,
"index" : "megacorp",
"node" : "yZnpVEOVSl-4Q6fyrU-1EQ",
"reason" : {
"type" : "query_parsing_exception",
"reason" : "Failed to parse",
"index" : "megacorp",
"caused_by" : {
"type" : "json_parse_exception",
"reason" : "Unexpected character (':' (code 58)): was expecting comma to separate ARRAY entries\n at [Source: [B@29d143; line: 1, column: 35]"
}

我搜索了这个问题,发现了类似的问题,例如 this,但是不幸的是它不起作用。使我感到困惑的是,尽管我复制了本书的代码,但仍然出现错误。有人可以帮我吗?非常感谢!

最佳答案

似乎例子中有错字。您需要将大括号更改为大括号:

GET /megacorp/employee/_search
{
"query" : {
"bool": {
"must": {
"match" : {
"last_name" : "smith"
}
},
"filter": {
"range" : {
"age" : { "gt" : 30 }
}
}
}
}
}

关于elasticsearch - elasticsearch query_parse_exception意外字符(':'(代码58)):期望逗号分隔数组条目\n,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36975077/

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