How to filter not_analyzed index using query_string

(Dharmraj Gurjar) #1
PUT index /_mapping /type  {
          "entityName": { "type": "string" ,"index": "not_analyzed" ,"doc_values": true}
PUT index/doc/1
     ` "entityName": "MML Code"`

 'query': {
            'match' : {
              'entityName' : {
                  'query' : '*m*',
                  'type' : 'phrase'

 <- 200
    "took": 2,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    "hits": {
      "total": 0,
      "max_score": null,
      "hits": []

(David Pilato) #2

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

Please format your code using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:


Please edit your post.

(Dharmraj Gurjar) #3

Please check now

(David Pilato) #4

Ok. I don't think I can copy and paste your example to reproduce in Kibana console as the syntax is mostly incorrect.

Anyway, could you explain the use case? Do you really want to run wildcard queries like this?

In case it helps, there is a similar thread here:

(system) #5

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