Match Prefix not giving any result


(Arcadix Infotech Pvt.Ltd) #1

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


(Prateek Gupta) #2

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.


(system) #3

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