# NGRAM Tokenizer Problem - segment writing can't keep up

**URL:** <https://discuss.elastic.co/t/ngram-tokenizer-problem-segment-writing-cant-keep-up/80179>\
**Category:** Elasticsearch\
**Created:** [March 27, 2017, 6:11pm UTC](https://discuss.elastic.co/t/ngram-tokenizer-problem-segment-writing-cant-keep-up/80179 "2017-03-27T18:11:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Whittaker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_whittaker/32/75325_2.png) [@Adam\_Whittaker](https://discuss.elastic.co/u/Adam_Whittaker)\
**Post date:** [March 27, 2017, 6:11pm UTC](https://discuss.elastic.co/t/ngram-tokenizer-problem-segment-writing-cant-keep-up/80179/1 "2017-03-27T18:11:55Z")

</div>

Hello,

I enabled an NGRAM Tokenizer on a field in one of my indexes (im using ElasticSearch 5.2.0) and after the indexing was complete my ElasticSearch stopped responding.

In checking the logs i kept seeing this error:

segment writing can't keep up... (followed by my index name). Nothing would work until i manually removed the indexes data folder.

I tested this on my dev server prior to prod and it worked fine (dev server has SSD vs spinning on prod).

I have never used an NGRAM tokenizer before so i am not sure if it just didnt work due to the performance of the prod VM vs my dev environment or if the error message means somthing else?

I did set my ngram max and min a bit extreme:  
.MinGram(1)  
MaxGram(500)

I set it like this because i wanted to be able to match the entire string and also small things like version numbers (that are captured in the string e.g. string:

\server\folder\folder2\test-document-product-v.1.2.5.x

I wanted users to be able to search for prod 1. and get results or doc 1.2 and get results.

Am i going about this the wrong way?

Thanks,

---

<div class="post-metadata">

**Author:** ![Adam\_Whittaker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_whittaker/32/75325_2.png) [@Adam\_Whittaker](https://discuss.elastic.co/u/Adam_Whittaker)\
**Post date:** [March 28, 2017, 3:23pm UTC](https://discuss.elastic.co/t/ngram-tokenizer-problem-segment-writing-cant-keep-up/80179/2 "2017-03-28T15:23:47Z")

</div>

I changed my bulk loading from 1000 to 100 and also added MaxThreadCount = 1 for the merge scheduler. After these changes i was able to successfully import without crashing the server.

I am not sure which one resolved my issue (or if it was both).

Thanks,

---

<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:** [April 25, 2017, 3:23pm UTC](https://discuss.elastic.co/t/ngram-tokenizer-problem-segment-writing-cant-keep-up/80179/3 "2017-04-25T15:23:46Z")

</div>

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