# Problem with context suggester when a document has more than 256 categories

**URL:** <https://discuss.elastic.co/t/problem-with-context-suggester-when-a-document-has-more-than-256-categories/21875>\
**Category:** Elasticsearch\
**Created:** [January 28, 2015, 1:43pm UTC](https://discuss.elastic.co/t/problem-with-context-suggester-when-a-document-has-more-than-256-categories/21875 "2015-01-28T13:43:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Goldenstein](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_goldenstein/32/959_2.png) [@Mark\_Goldenstein](https://discuss.elastic.co/u/Mark_Goldenstein)\
**Post date:** [January 28, 2015, 1:43pm UTC](https://discuss.elastic.co/t/problem-with-context-suggester-when-a-document-has-more-than-256-categories/21875/1 "2015-01-28T13:43:10Z")

</div>

Hi,

I use the context suggester, well, for suggestions and I have more than 256  
different categories.

When I try to index a document with 257 categories, I get the following  
error:

{  
"error":"IllegalArgumentException[TokenStream expanded to 257 finite  
strings. Only \<= 256 finite strings are supported]",  
"status":500  
}

I have uploaded a simple curl example  
here: [https://gist.github.com/goldmar/2c3f64575df420a5413a](https://gist.github.com/goldmar/2c3f64575df420a5413a)

Is this a bug or an expected limitation? How can I solve this problem (e.g.  
increase the number of possible categories)?

Also, please note that the documentation does not mention this  
limitation: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html)

Best regards,  
Mark

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0554d4a8-3ee9-4ecf-b030-bccd920b637c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0554d4a8-3ee9-4ecf-b030-bccd920b637c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:36am UTC](https://discuss.elastic.co/t/problem-with-context-suggester-when-a-document-has-more-than-256-categories/21875/2 "2017-07-06T00:36:09Z")

</div>


