# @uboness how to improve the accuracy of terms aggregation

**URL:** https://discuss.elastic.co/t/uboness-how-to-improve-the-accuracy-of-terms-aggregation/21308
**Category:** Elasticsearch
**Created:** [December 18, 2014, 7:27am UTC](https://discuss.elastic.co/t/uboness-how-to-improve-the-accuracy-of-terms-aggregation/21308 "2014-12-18T07:27:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yang\_ming](https://avatars.discourse-cdn.com/v4/letter/y/ecb155/32.png) [@yang\_ming](https://discuss.elastic.co/u/yang_ming)
#### Post date: [December 18, 2014, 7:27am UTC](https://discuss.elastic.co/t/uboness-how-to-improve-the-accuracy-of-terms-aggregation/21308/1 "2014-12-18T07:27:47Z")

</div>

Hi All

```
we use the terms aggregation to get the top n authors, but the 

```

aggregation may not return the top n authors.

```
As the elasticsearch guide said, the aggregated results are not always 

```

accurate.

```
Indeed we can increase the shard size to get more accurate results, but 

```

if the buckets returned by each shard are big enough, there will be a a  
bottleneck in master node reducing the final result.

```
Is there a other way to improve the accuracy of terms aggregation?

Is there a good way to decrease the press of master node when executing 

```

the reducing phase?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [December 18, 2014, 2:37pm UTC](https://discuss.elastic.co/t/uboness-how-to-improve-the-accuracy-of-terms-aggregation/21308/2 "2014-12-18T14:37:39Z")

</div>

For the record, the bottleneck would not be on the master node (the node  
that manages the cluster state) but on the node that coordinates the  
execution of the search request, which is the node that your client  
contacts. So if you are doing costly terms aggregations with high shard  
sizes, it would help to round-robin between several nodes.

If you are interested in the accuracy issues of the terms aggregation, I  
would recommend reading

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

and upgrading to elasticsearch 1.4 which now returns an error bound on the  
counts, so that you know how bad the counts might be. The only way to  
improve accuracy is to increase the shard size, but as you noted, this  
raises issues too.

On Thu, Dec 18, 2014 at 8:27 AM, yang ming [ymbloy@gmail.com](mailto:ymbloy@gmail.com) wrote:

> Hi All
> 
> ```
> we use the terms aggregation to get the top n authors, but the
> 
> ```
> 
> aggregation may not return the top n authors.
> 
> ```
> As the elasticsearch guide said, the aggregated results are not always
> 
> ```
> 
> accurate.
> 
> ```
> Indeed we can increase the shard size to get more accurate results,
> 
> ```
> 
> but if the buckets returned by each shard are big enough, there will be a a  
> bottleneck in master node reducing the final result.
> 
> ```
> Is there a other way to improve the accuracy of terms aggregation?
> 
> Is there a good way to decrease the press of master node when
> 
> ```
> 
> executing the reducing phase?
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0b83a2d6-8bd0-41dc-9e58-3b797949ca53%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7YSEwmJfWV87V\_C1tyhSa6XdHCs54RJEBdqoBuEEKnHQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7YSEwmJfWV87V_C1tyhSa6XdHCs54RJEBdqoBuEEKnHQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:42am UTC](https://discuss.elastic.co/t/uboness-how-to-improve-the-accuracy-of-terms-aggregation/21308/3 "2017-07-06T00:42:52Z")

</div>


