As I read through document for Terms Aggregation, I came across the fact that the results from Term Aggregation are not always accurate, but we can increase the size to get the accurate results.
I know : -
How Query-Then-Fetch works.
How top terms are calculated at each shard(shard_size) and then merge at co-ordinator node(size).
What "doc_count_error_upper_bound" means, and how it can help in determining that there may be error in top results and we need to increase the size.
But is there any mathematical approach or any other way, with help of which we can determine the correct size that we should ask for once we get in-accurate results for the first time?