gpt4 book ai didi

elasticsearch - multi_match 查询格式错误,应为 END_OBJECT,但找到了 FIELD_NAME

转载 作者:行者123 更新时间:2023-12-04 06:03:31 24 4
gpt4 key购买 nike

{
"from":0,
"size":1000,
"query": {
"bool": {
"must": [
{
"query": {

"multi_match": {
"query": "shampoo",
"fields": ["summary.exact", "promotionid.basic"],
"type": "cross_fields",
"minimum_should_match" : "100%"
}
}
},
{
"bool": {
"should": [
{"term": {"is_non_ecomm": "1"}}
],
"must": [
{"term": {
"iscouponactive": "1"
}}
]
}
}
]

}
}
}

我正在从 2x 迁移到 5x,但我的查询失败。这是我收到的错误:

[multi_match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":32,"col":13}],"type":"parsing_exception","reason":"[multi_match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":32,"col":13}

最佳答案

您不需要在 multi_match 约束周围添加 query:

{
"from": 0,
"size": 1000,
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "shampoo",
"fields": [
"summary.exact",
"promotionid.basic"
],
"type": "cross_fields",
"minimum_should_match": "100%"
}
},
{
"bool": {
"should": [
{
"term": {
"is_non_ecomm": "1"
}
}
],
"must": [
{
"term": {
"iscouponactive": "1"
}
}
]
}
}
]
}
}
}

关于elasticsearch - multi_match 查询格式错误,应为 END_OBJECT,但找到了 FIELD_NAME,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47245442/

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