Quesofat
Quesofat

Reputation: 1531

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

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!!

Upvotes: 2

Views: 5598

Answers (1)

Bhavya
Bhavya

Reputation: 16172

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"
          }
        }
      ]
    }
  }
}

Upvotes: 3

Related Questions