{
"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"
}}
]
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在从 2x 迁移到 5x,但我的查询失败了。这是我得到的错误:
[multi_match] 格式错误的查询,预期 [END_OBJECT] 但发现 [FIELD_NAME]","line":32,"col":13}],"type":"parsing_exception","reason":"[multi_match] 格式错误的查询,预期 [END_OBJECT] 但找到 [FIELD_NAME]","line":32,"col":13}
您不需要query在multi_match约束周围添加:
{
"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"
}
}
]
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6610 次 |
| 最近记录: |