How can i improve accuracy of term aggregation?

Hello,

I am creating visualizations in which term aggregation is not showing accurate values. How can i increase accuracy and make it exact value so that i can have proper visualization?

Thank You,
Meet

Hey @meetdave2611997 the following article explains the way document counts are calculated for the terms aggregation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-approximate-counts and what can be done to improve the situation

So this is dynamic solution right? for example i have specified shard_size: 500 and it is showing correct results for last 15 days. But what if someone searches data for last 30 days. this value would not work. In that case what should i do?

Thank You,
Meet

@meetdave2611997 you could potentially hard-code the shard_size to a large enough number that it gives you exact results for all expected query parameters; however, this definitely isn't ideal.

Unfortunately, this is one of the trade-offs that Elasticsearch has made to support these types of queries against really large data-sets, so there isn't a scalable way to ensure that this value is exact without trading off memory usage within the cluster.

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