multi_match 格式错误的查询,预期为 END_OBJECT,但找到了 FIELD_NAME

Far*_*raz 2 elasticsearch

{
"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","re​​ason":"[multi_match] 格式错误的查询,预期 [END_OBJECT] 但找到 [FIELD_NAME]","line":32,"col":13}

Val*_*Val 5

您不需要querymulti_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)