# Agg results can't support long words

**URL:** <https://discuss.elastic.co/t/agg-results-cant-support-long-words/286590>\
**Category:** Elasticsearch\
**Created:** [October 13, 2021, 8:16am UTC](https://discuss.elastic.co/t/agg-results-cant-support-long-words/286590 "2021-10-13T08:16:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 13, 2021, 1:38pm UTC](https://discuss.elastic.co/t/agg-results-cant-support-long-words/286590/2 "2021-10-13T13:38:21Z")

</div>

Hi,  
The `size` and `shard_size` parameters you call out define the maximum numbers of terms you want in the results.  
The problem you have is likely at index-time rather than query time. The large stack trace string probably [exceeds the default indexable size for keyword fields.](https://discuss.elastic.co/t/i-need-help-elasticsearch-does-not-match-my-regexp-wildcard-or-query-string-queries/239473).

One approach to aggregating on large values like this would be to index a hashcode for the string rather than the full value.  
If your content consists of a lot of things like these stack traces the [wildcard field](https://www.elastic.co/blog/find-strings-within-strings-faster-with-the-new-elasticsearch-wildcard-field) may also be of interest but pay attention to the flowchart at the end of the blog when deciding if it is appropriate

---

_[View the full topic](https://discuss.elastic.co/t/agg-results-cant-support-long-words/286590)._
