Match Prefix not giving any result

Hi

i want to do substring search (Like operation)

get state/_search      
{
  "from":0,
  "size": 1000
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase_prefix": {
            "StateName" : "*p*"
          }
        }
      ]
    }
    }

}

This not giving any results.

Thanks
Aneesh

Prefix matches just the prefix part and doesn't allow wildcard match. If you want to do a like match you should use a match_phrase query or if you want a wildcard match then use wildcard query.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.