# How to prevent ngram omits words that have length \< ngram.minLength

**URL:** <https://discuss.elastic.co/t/how-to-prevent-ngram-omits-words-that-have-length-ngram-minlength/12200>\
**Category:** Elasticsearch\
**Created:** [May 31, 2013, 6:24am UTC](https://discuss.elastic.co/t/how-to-prevent-ngram-omits-words-that-have-length-ngram-minlength/12200 "2013-05-31T06:24:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dqduc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dqduc/32/86788_2.png) [@dqduc](https://discuss.elastic.co/u/dqduc)\
**Post date:** [May 31, 2013, 6:24am UTC](https://discuss.elastic.co/t/how-to-prevent-ngram-omits-words-that-have-length-ngram-minlength/12200/1 "2013-05-31T06:24:36Z")

</div>

Hi all,  
Is there anyway to keep the words that shorter than min length of ngram ?  
For example:  
the data is "abc x" ==\> ngram(2,4) will generates: ab, bc, abc. It remove  
"x" since "x" has length=1. I want to keep "x" because it still a keyword.  
What filters I need to use in order to keep it? I'm using ES 0.90 ?  
I think ngram should have an option to keep shorter words like this case.

Thanks,  
Duc

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:33am UTC](https://discuss.elastic.co/t/how-to-prevent-ngram-omits-words-that-have-length-ngram-minlength/12200/2 "2017-07-06T02:33:44Z")

</div>


