# How to debug aggregation problems?

**URL:** <https://discuss.elastic.co/t/how-to-debug-aggregation-problems/17879>\
**Category:** Elasticsearch\
**Created:** [June 3, 2014, 9:51am UTC](https://discuss.elastic.co/t/how-to-debug-aggregation-problems/17879 "2014-06-03T09:51:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [June 3, 2014, 9:51am UTC](https://discuss.elastic.co/t/how-to-debug-aggregation-problems/17879/1 "2014-06-03T09:51:22Z")

</div>

I have an aggregation (filter + daterange) that is giving me an incorrect  
result (the count for a bucket is 2 when I expect 1) - but when I search  
using the same\* criteria, I get only the 1 result I expect.  
I am wondering what techniques there are for trying to debug the  
aggregation - to try figure out why I get a count of 2 instead of 1.

- The criteria are almost the same - there is a process of turning one of  
the buckets of the date-range aggregation into a date range filter - but as  
it happens, this is not the part that is generating the incorrect results.

--  
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/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 16, 2014, 11:50am UTC](https://discuss.elastic.co/t/how-to-debug-aggregation-problems/17879/2 "2014-06-16T11:50:16Z")

</div>

Hey,

if you think this is a bug, please try to create a reproducible example and  
file a github issue. See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
If you are using the terms aggregation, you might want to read this one as  
well before filing a bug:  
[https://github.com/elasticsearch/elasticsearch/issues/1305](https://github.com/elasticsearch/elasticsearch/issues/1305)

--Alex

On Tue, Jun 3, 2014 at 11:51 AM, mooky [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:

> I have an aggregation (filter + daterange) that is giving me an incorrect  
> result (the count for a bucket is 2 when I expect 1) - but when I search  
> using the same\* criteria, I get only the 1 result I expect.  
> I am wondering what techniques there are for trying to debug the  
> aggregation - to try figure out why I get a count of 2 instead of 1.
> 
> - The criteria are almost the same - there is a process of turning one of  
> the buckets of the date-range aggregation into a date range filter - but as  
> it happens, this is not the part that is generating the incorrect results.
> 
> --  
> 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/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/49b01a36-bc17-4c59-b7d6-d100fe455ec5%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGCwEM8v1iPOuJRxPf%2Brq1aO6o76yNvOk6EzSKwzcVTzuhLv2g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8v1iPOuJRxPf%2Brq1aO6o76yNvOk6EzSKwzcVTzuhLv2g%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, 1:22am UTC](https://discuss.elastic.co/t/how-to-debug-aggregation-problems/17879/3 "2017-07-06T01:22:15Z")

</div>


