Warm tip: This article is reproduced from serverfault.com, please click

ruby-匹配查询格式不正确,查询名称后没有start_object“ Elasticsearch 7.1

(ruby - match query malformed, no start_object after query name" Elasticsearch 7.1)

发布于 2020-11-27 18:28:19

我目前遇到以下错误:

Elasticsearch 7.1中的“ [匹配]查询格式错误,查询名称后没有start_object”

POST /职位/ _搜索

使用以下查询:

{"query": {
    "bool": {
        "must": {
          "match": [
            {"city": "chicago"},
            {"state": "illinois"}
          ]
        }
      }
}}

我如何才能再次使用它?

谢谢!!

Questioner
Quesofat
Viewed
0
ESCoder 2020-11-28 07:42:20

该错误清楚地表明你的布尔查询格式不正确。试用以下查询:

{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "city": "chicago"
          }
        },
        {
          "match": {
            "state": "illinois"
          }
        }
      ]
    }
  }
}