Karthikeyan
Karthikeyan

Reputation: 2011

Kibana am getting this, parsing_exception : [multi_match] unknown token [START_OBJECT] after [query] error

Am trying to fetch records from elasticsearch via kibana using multi_match query but am getting error response.

Please find my multi match query below.

GET /_search
{
  "query": {
    "multi_match" : {
     "query": {
        "prefix" : { "code" : "M" }
    }
      "fields": [ "code", "_id" ] 
    }
  }
}

Am getting the below error response.

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[multi_match] unknown token [START_OBJECT] after [query]",
        "line": 4,
        "col": 15
      }
    ],
    "type": "parsing_exception",
    "reason": "[multi_match] unknown token [START_OBJECT] after [query]",
    "line": 4,
    "col": 15
  },
  "status": 400
}

Upvotes: 0

Views: 5296

Answers (1)

Val
Val

Reputation: 217584

You cannot combine a prefix query with multi_match, depending on your mapping, you might be able to do it like this instead:

GET /_search
{
    "query": {
        "query_string" : {
            "default_field" : "*",
            "query" : "M*"
        }
    }
}

Upvotes: 1

Related Questions