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

match query malformed, no start_object after query name" Elasticsearch 7.1

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

I'm currently getting the following error:

"[match] query malformed, no start_object after query name" in Elasticsearch 7.1

POST /jobs/_search

with the following query:

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

How can I get this working again?

Thanks!!

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

The error clearly indicates that your bool query is not correctly formed. Try out the below query:

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