Agg results can't support long words

Hello experts,
I'm currently trying to excute aggregate request,but I can't get some results which the field value is a little long,and I can't find any information for the length of field value to aggregate on guide,this got me into trouble.Is there some relevant descriptions of the value length limit for aggregation?


There is result.

the following result doesn't return the long value

Is there some relevant descriptions of the value length limit for aggregation?
Looking forward to any help! Thank you!

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

Thank you very much,I find,But how to index a hashcode for the string like you said.

You can do it

  1. in any client code that presents the JSON (custom code, Logstash etc)
  2. in an “ingest processor” that enriches the JSON on Elasticsearch nodes just before indexing or
  3. in indexing code using the murmur3 field type