Agg results can't support long words

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..

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 may also be of interest but pay attention to the flowchart at the end of the blog when deciding if it is appropriate