# Effect of "enable accuracy mode" on "shard\_size"

**URL:** <https://discuss.elastic.co/t/effect-of-enable-accuracy-mode-on-shard-size/374648>\
**Category:** Kibana\
**Created:** [February 17, 2025, 4:58pm UTC](https://discuss.elastic.co/t/effect-of-enable-accuracy-mode-on-shard-size/374648 "2025-02-17T16:58:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antay](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@antay](https://discuss.elastic.co/u/antay)\
**Post date:** [February 17, 2025, 4:58pm UTC](https://discuss.elastic.co/t/effect-of-enable-accuracy-mode-on-shard-size/374648/1 "2025-02-17T16:58:57Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [February 18, 2025, 11:36am UTC](https://discuss.elastic.co/t/effect-of-enable-accuracy-mode-on-shard-size/374648/2 "2025-02-18T11:36:46Z")

</div>

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](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx#L288)

---

<div class="post-metadata">

**Author:** ![antay](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@antay](https://discuss.elastic.co/u/antay)\
**Post date:** [February 18, 2025, 12:05pm UTC](https://discuss.elastic.co/t/effect-of-enable-accuracy-mode-on-shard-size/374648/3 "2025-02-18T12:05:56Z")

</div>

Awesome, thanks a lot!
