# How to filter not\_analyzed index using query\_string

**URL:** <https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970>\
**Category:** Elasticsearch\
**Created:** [February 8, 2018, 5:45am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970 "2018-02-08T05:45:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharmraj](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dharmraj](https://discuss.elastic.co/u/Dharmraj)\
**Post date:** [February 8, 2018, 5:45am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970/1 "2018-02-08T05:45:00Z")

</div>

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

GET/index/_search{
 'query': {
            'match' : {
              'entityName' : {
                  'query' : '*m*',
                  'type' : 'phrase'
              }
          }
  }
}	  
**_Result_**

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 6:14am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970/2 "2018-02-08T06:14:39Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). 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](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Please edit your post.

---

<div class="post-metadata">

**Author:** ![Dharmraj](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dharmraj](https://discuss.elastic.co/u/Dharmraj)\
**Post date:** [February 8, 2018, 6:46am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970/3 "2018-02-08T06:46:10Z")

</div>

Please check now

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 8:02am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970/4 "2018-02-08T08:02:23Z")

</div>

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:

> [@Wildcard / regexp in a phrase which has space](https://discuss.elastic.co/t/wildcard-regexp-in-a-phrase-which-has-space/117962/16):
>
> It has issues. DELETE test PUT test { "settings": { "analysis": { "analyzer": { "my\_analyzer": { "tokenizer": "standard", "filter": ["lowercase", "ngram"] } }, "filter": { "ngram": { "type": "edge\_ngram", "min\_gram": 1, "max\_gram": 20, "token\_chars": ["letter", "digit"] } } } }, "mappings": { "doc": { …

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 8, 2018, 8:02am UTC](https://discuss.elastic.co/t/how-to-filter-not-analyzed-index-using-query-string/118970/5 "2018-03-08T08:02:53Z")

</div>

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