# Stats, extended stats, percentiles for doc\_count in aggregations

**URL:** <https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313>\
**Category:** Elasticsearch\
**Created:** [May 2, 2014, 6:56am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313 "2014-05-02T06:56:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [May 2, 2014, 6:56am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313/1 "2014-05-02T06:56:59Z")

</div>

Is it possible to get stats, extended stats, or percentiles across the  
doc\_counts in each bucket of an aggregation? I see how to use it on an  
existing numeric field value (e.g., height, grade), but I want to see the  
average bucket size, stddev, or other stats on how one doc\_count compares  
to doc\_counts in the other buckets.

--  
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/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%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:** [May 2, 2014, 7:21am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313/2 "2014-05-02T07:21:51Z")

</div>

Hi,

There is currently no way to do that but I think this could be done on  
client side?

On Fri, May 2, 2014 at 8:56 AM, Loren [loren@siebert.org](mailto:loren@siebert.org) wrote:

> Is it possible to get stats, extended stats, or percentiles across the  
> doc\_counts in each bucket of an aggregation? I see how to use it on an  
> existing numeric field value (e.g., height, grade), but I want to see the  
> average bucket size, stddev, or other stats on how one doc\_count compares  
> to doc\_counts in the other buckets.
> 
> --  
> 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/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%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/CAL6Z4j5nYVvcxUPAtH06Sbw7oayGPNF6x%2BLEkKmWkwtgHqqLKA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5nYVvcxUPAtH06Sbw7oayGPNF6x%2BLEkKmWkwtgHqqLKA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [May 2, 2014, 7:37am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313/3 "2014-05-02T07:37:08Z")

</div>

Thanks for the quick reply, Adrien. Yep, I can certainly pull all the  
doc\_counts down to the client and calculate it all there. I was just hoping  
to avoid that.

On Friday, May 2, 2014 12:21:51 AM UTC-7, Adrien Grand wrote:

> Hi,
> 
> There is currently no way to do that but I think this could be done on  
> client side?
> 
> On Fri, May 2, 2014 at 8:56 AM, Loren \<[lo...@siebert.org](mailto:lo...@siebert.org) \<javascript:\>\>wrote:
> 
> > Is it possible to get stats, extended stats, or percentiles across the  
> > doc\_counts in each bucket of an aggregation? I see how to use it on an  
> > existing numeric field value (e.g., height, grade), but I want to see the  
> > average bucket size, stddev, or other stats on how one doc\_count compares  
> > to doc\_counts in the other buckets.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%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/9d85540c-6568-4a29-9906-e846f21e4c0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d85540c-6568-4a29-9906-e846f21e4c0c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Raz\_Lachyani](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@Raz\_Lachyani](https://discuss.elastic.co/u/Raz_Lachyani)\
**Post date:** [October 15, 2014, 8:11am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313/4 "2014-10-15T08:11:14Z")

</div>

Hi Loren,

Maybe it is possible to use sum. I think you can try to find field or  
create one that when U use sum so its weight is equivalent to the  
doc\_count.  
I haven't tried it yet, its just a thought.

On Friday, May 2, 2014 10:37:08 AM UTC+3, Loren wrote:

> Thanks for the quick reply, Adrien. Yep, I can certainly pull all the  
> doc\_counts down to the client and calculate it all there. I was just hoping  
> to avoid that.
> 
> On Friday, May 2, 2014 12:21:51 AM UTC-7, Adrien Grand wrote:
> 
> > Hi,
> > 
> > There is currently no way to do that but I think this could be done on  
> > client side?
> > 
> > On Fri, May 2, 2014 at 8:56 AM, Loren [lo...@siebert.org](mailto:lo...@siebert.org) wrote:
> > 
> > > Is it possible to get stats, extended stats, or percentiles across the  
> > > doc\_counts in each bucket of an aggregation? I see how to use it on an  
> > > existing numeric field value (e.g., height, grade), but I want to see the  
> > > average bucket size, stddev, or other stats on how one doc\_count compares  
> > > to doc\_counts in the other buckets.
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8f847621-e92c-4bdf-915f-60bd799071ee%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/efb12592-0c59-466e-83c1-bd92ba43dfa3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/efb12592-0c59-466e-83c1-bd92ba43dfa3%40googlegroups.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:56am UTC](https://discuss.elastic.co/t/stats-extended-stats-percentiles-for-doc-count-in-aggregations/17313/5 "2017-07-06T00:56:07Z")

</div>


