elasticsearch,kibana,Json,elasticsearch,Kibana" /> elasticsearch,kibana,Json,elasticsearch,Kibana" />

Json 预期为[END_OBJECT],但获得了[FIELD_NAME],kibana中可能存在过多查询子句错误

Json 预期为[END_OBJECT],但获得了[FIELD_NAME],kibana中可能存在过多查询子句错误,json,elasticsearch,kibana,Json,elasticsearch,Kibana,当我试图组成一个复合bool查询时,它有一个模糊的must需求和几个shoul-req,其中一个是通配符,我遇到了这个错误消息。到目前为止,对语法的任何修改都没有帮助我解决这个问题 查询: { "query": { "bool": { "must": { "fuzzy": { "message": "<fuzzy string>",

当我试图组成一个复合bool查询时,它有一个模糊的must需求和几个shoul-req,其中一个是通配符,我遇到了这个错误消息。到目前为止,对语法的任何修改都没有帮助我解决这个问题

查询:

{
    "query": {
        "bool": {
            "must": {
                "fuzzy": {
                    "message": "<fuzzy string>",
                    "fuzziness": "auto"
                }
            },
          "should": [
            { "query": { "message": "<string>" } },
            { "query": { "message": "<string>" } },
            { "wildcard": 
                {
                    "query": { "message": "<partial string*>"}
                } 
            }
          ],
          "minimum_should_match": "50%"
        }
    } 
}
{
“查询”:{
“布尔”:{
“必须”:{
“模糊”:{
“电文”:“,
“模糊性”:“自动”
}
},
“应该”:[
{“查询”:{“消息”:“}},
{“查询”:{“消息”:“}},
{“通配符”:
{
“查询”:{“消息”:“”}
} 
}
],
“最低应匹配”:“50%”
}
} 
}

中的文本将替换为我搜索的字符串。

您需要在
bool/should
子句中将
query
替换为
match

> {   "query": {
>      "bool": {
>       "must": {
>         "fuzzy": {
>           "message": "<fuzzy string>",
>           "fuzziness": "auto"
>         }
>       },
>       "should": [
>         {"match": {"message": "<string>"}},                        <-- here
>         {"match": {"message": "<string>"}},                        <-- and here
>         {"wildcard": {"query": {"message": "<partial string*>"}}}
>       ],
>       "minimum_should_match": "50%"
>     }   } }
{“查询”:{
>“布尔”:{
>“必须”:{
>“模糊”:{
>“电文”:“,
>“模糊性”:“自动”
>         }
>       },
>“应该”:[
>{“匹配”:{“消息”:“}}},{“匹配”:{“消息”:“}},{“通配符”:{“查询”:{“消息”:“}}}
>       ],
>“最低应匹配”:“50%”
>     }   } }

您需要在
bool/should
子句中将
查询
替换为
匹配

> {   "query": {
>      "bool": {
>       "must": {
>         "fuzzy": {
>           "message": "<fuzzy string>",
>           "fuzziness": "auto"
>         }
>       },
>       "should": [
>         {"match": {"message": "<string>"}},                        <-- here
>         {"match": {"message": "<string>"}},                        <-- and here
>         {"wildcard": {"query": {"message": "<partial string*>"}}}
>       ],
>       "minimum_should_match": "50%"
>     }   } }
{“查询”:{
>“布尔”:{
>“必须”:{
>“模糊”:{
>“电文”:“,
>“模糊性”:“自动”
>         }
>       },
>“应该”:[
>{“匹配”:{“消息”:“}}},{“匹配”:{“消息”:“}},{“通配符”:{“查询”:{“消息”:“}}}
>       ],
>“最低应匹配”:“50%”
>     }   } }

在您提到的地方用“查询”替换“匹配”根本没有改变结果:\I再次遇到相同的错误
之间的字符串有多长?fuzzy是5个字符,第一个应该是3个字符,第二个是6个字符,通配符是4个字符,然后是*通配符将“查询”替换为“匹配”在您提到的地方,结果根本没有改变:\n我又遇到了同样的错误,
之间的字符串有多长?fuzzy是5个字符,第一个应该是3个字符,第二个是6个字符,通配符是4个字符,然后是*通配符