gpt4 book ai didi

elasticsearch - 格式错误的查询,预期为 END_OBJECT,但在 Kibana( Elasticsearch )中发现了 FIELD_NAME 错误

转载 作者:行者123 更新时间:2023-11-29 02:45:46 26 4
gpt4 key购买 nike

我在我的 Kibana 控制台中运行以下 GET 查询,由于某种原因,我在响应窗口中收到如下错误:

//错误

[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]

谁能告诉我为什么我不能在“应该”部分使用多个匹配 block ?

//响应 - 如果我取出其中一个匹配 block ,它会起作用吗??

{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 9,
"col": 13
}
],
"type": "parsing_exception",
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 9,
"col": 13
},
"status": 400
}

//我的查询

GET _search
{
"query": {
"bool": {
"should": [
{
"match": {
"text": "facebook advice"
},
"match": {
"profile": "facebook advice"
}
}
],
"minimum_number_should_match": 1,
"filter": {
"term": {
"accountid": "22"
}
}
}
}

最佳答案

您的查询格式不正确。改为这样写:

GET _search
{
"query": {
"bool": {
"should": [
{
"match": {
"text": "facebook advice"
}
},
{
"match": {
"profile": "facebook advice"
}
}
],
"minimum_number_should_match": 1,
"filter": {
"term": {
"accountid": "22"
}
}
}
}
}

关于elasticsearch - 格式错误的查询,预期为 END_OBJECT,但在 Kibana( Elasticsearch )中发现了 FIELD_NAME 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44306569/

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