# Need Ngram\_analyzer settings

**URL:** <https://discuss.elastic.co/t/need-ngram-analyzer-settings/155712>\
**Category:** Elasticsearch\
**Created:** [November 7, 2018, 12:23pm UTC](https://discuss.elastic.co/t/need-ngram-analyzer-settings/155712 "2018-11-07T12:23:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad.ram1431](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@prasad.ram1431](https://discuss.elastic.co/u/prasad.ram1431)\
**Post date:** [November 7, 2018, 12:23pm UTC](https://discuss.elastic.co/t/need-ngram-analyzer-settings/155712/1 "2018-11-07T12:23:54Z")

</div>

Hi,

Could someone help me on the below issue.

I have below field in my index,

> "postalcode" : 123 456

below mapping for the field,

> "postalCode": {  
> "type": "text",  
> "fields": {  
> "keyword": {  
> "type": "keyword",  
> "ignore\_above": 256  
> }  
> },  
> "analyzer": "ngram\_analyzer",  
> "search\_analyzer": "standard"  
> }

below settings for ngram\_analyzer

> "settings": {  
> "index": {  
> "number\_of\_shards": "5",  
> "analysis": {  
> "filter": {  
> "ngram\_filter": {  
> "type": "edge\_ngram",  
> "min\_gram": "2",  
> "max\_gram": "20"  
> },  
> "ascii\_filter": {  
> "type": "asciifolding",  
> "preserve\_original" : true  
> }  
> },  
> "analyzer": {  
> "ngram\_analyzer": {  
> "filter": [  
> "lowercase",  
> "ngram\_filter",  
> "ascii\_filter"  
> ],  
> "type": "custom",  
> "tokenizer": "standard"  
> }  
> }  
> },  
> "number\_of\_replicas": "2"  
> }  
> }

below are my different search scenarios of postalCode field,

1. postalCode: 12
2. postalCode: 123456
3. postalCode: 123 456

Please help me on how to get the document for these different search query scenarios.  
All the three search scenarios should return the document which  
contains postalCode : 123 456 value

Thanks,  
Ram Prasad G

---

<div class="post-metadata">

**Author:** ![prasad.ram1431](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@prasad.ram1431](https://discuss.elastic.co/u/prasad.ram1431)\
**Post date:** [November 9, 2018, 5:36am UTC](https://discuss.elastic.co/t/need-ngram-analyzer-settings/155712/2 "2018-11-09T05:36:06Z")

</div>

Hi,

Any inputs or suggestions please.

Thanks,  
Ram Prasad G

---

<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:** [December 7, 2018, 5:49am UTC](https://discuss.elastic.co/t/need-ngram-analyzer-settings/155712/3 "2018-12-07T05:49:41Z")

</div>

Closed on December 7, 2018, 5:49am UTC

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