Match Prefix not giving any result


i want to do substring search (Like operation)

get state/_search      
  "size": 1000
  "query": {
    "bool": {
      "must": [
          "match_phrase_prefix": {
            "StateName" : "*p*"


This not giving any results.


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.