[ES v7.9.1] What is the largest useful size setting for terms aggregations

In order to get all the existing data we set the size parameter for each terms aggregation to 2147483647 (Integer.MAX)

Depending on the number of documents, these queries run forever and consume massive memory. Actually our ES cluster is not usable any longer and needs a restart.

When we decrease the value for the size parameters in the terms query, the query can be executed but fails with "too_many_buckets_exception".
This is absolutely fine for us, since we just want any kind of circuit breaker that prevents our cluster to crash.

Since the query would fail anyway with "too_many_buckets_exception", I wonder if there is any reason to set the size parameter for the terms queries greater than our configured search.max_buckets value +1 or even the cardinality for the specific term +1, if we knew the cardinality exactly.

1 Like

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