Effect of "enable accuracy mode" on "shard_size"

I believe I understand the effect of the "shard_size" parameter in relation to Terms aggregations, described here: https://www.elastic.co/guide/en/elasticsearch/reference/8.15/search-aggregations-bucket-terms-aggregation.html

I also found a discussion that implies that Kibana's "Enable accuracy mode" option increases the "shard_size" parameter in the query (https://discuss.elastic.co/t/top3-in-line-graph-and-top-values-in-available-fields-are-different/310382/4).

I'm looking to find out exactly how Accuracy Mode modifies "shard_size"?

Thanks

Hi @antay

the Lens editor will try to increase up to 1000 the value of shard_size based on the number of top values requested.
The actual formula used can be found here: kibana/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx at main · elastic/kibana · GitHub

Awesome, thanks a lot!