# Aggregation not limited to filter?

**URL:** <https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190>\
**Category:** Elasticsearch\
**Created:** [April 10, 2015, 4:39pm UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190 "2015-04-10T16:39:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmkgreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmkgreen/32/471_2.png) [@jmkgreen](https://discuss.elastic.co/u/jmkgreen)\
**Post date:** [April 10, 2015, 4:39pm UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/1 "2015-04-10T16:39:35Z")

</div>

I must be doing something stupid!

Using the Java client I can perform a search with a filter and iterate over  
the hits. I see exactly the right source documents.

If I add an aggregation, I see the expected keyAsText string but the  
docCount reflects the volume if the filter had not been applied.

I expected the aggregation to be restricted to the results within that  
filter?

Thanks,

James

--  
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/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![James\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@James\_Macdonald](https://discuss.elastic.co/u/James_Macdonald)\
**Post date:** [April 10, 2015, 8:17pm UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/2 "2015-04-10T20:17:26Z")

</div>

I had a similar problem recently and solved it by moving my filter into a  
filtered query (leaving the query as a match\_all), see documentation here

> **[Filtered Query | Elasticsearch Guide \[1.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-filtered-query.html)**

.

I am not certain why filters do not restrict the scope of the aggregates,  
but queries do, but I suspect it interprets the filter (not wrapped in a  
filtered\_query) as a post\_filter (  
[http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html)).  
Maybe someone else actually knows why.

Hope that helps,  
James

On Fri, Apr 10, 2015 at 11:39 AM, James Green [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com)  
wrote:

> I must be doing something stupid!
> 
> Using the Java client I can perform a search with a filter and iterate  
> over the hits. I see exactly the right source documents.
> 
> If I add an aggregation, I see the expected keyAsText string but the  
> docCount reflects the volume if the filter had not been applied.
> 
> I expected the aggregation to be restricted to the results within that  
> filter?
> 
> Thanks,
> 
> James
> 
> --  
> 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/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.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/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jmkgreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmkgreen/32/471_2.png) [@jmkgreen](https://discuss.elastic.co/u/jmkgreen)\
**Post date:** [April 13, 2015, 11:33am UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/3 "2015-04-13T11:33:30Z")

</div>

Indeed. I had used postFilter to add my filters. The documentation for  
filters doesn't show how to use a query with a matchAll and a bunch of  
filters so I blindly followed IDE auto-complete.

Lesson learned.

On 10 April 2015 at 21:17, James Macdonald [james.macdonald@geofeedia.com](mailto:james.macdonald@geofeedia.com)  
wrote:

> I had a similar problem recently and solved it by moving my filter into a  
> filtered query (leaving the query as a match\_all), see documentation here  
> [Filtered Query | Elasticsearch Guide [1.5] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-filtered-query.html)  
> .
> 
> I am not certain why filters do not restrict the scope of the aggregates,  
> but queries do, but I suspect it interprets the filter (not wrapped in a  
> filtered\_query) as a post\_filter (  
> [http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html)).  
> Maybe someone else actually knows why.
> 
> Hope that helps,  
> James
> 
> On Fri, Apr 10, 2015 at 11:39 AM, James Green [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com)  
> wrote:
> 
> > I must be doing something stupid!
> > 
> > Using the Java client I can perform a search with a filter and iterate  
> > over the hits. I see exactly the right source documents.
> > 
> > If I add an aggregation, I see the expected keyAsText string but the  
> > docCount reflects the volume if the filter had not been applied.
> > 
> > I expected the aggregation to be restricted to the results within that  
> > filter?
> > 
> > Thanks,
> > 
> > James
> > 
> > --  
> > 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/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.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/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.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/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X\_awGD3wR8B-vVZY-A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X_awGD3wR8B-vVZY-A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jmkgreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmkgreen/32/471_2.png) [@jmkgreen](https://discuss.elastic.co/u/jmkgreen)\
**Post date:** [April 13, 2015, 11:33am UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/4 "2015-04-13T11:33:31Z")

</div>

Indeed. I had used postFilter to add my filters. The documentation for  
filters doesn't show how to use a query with a matchAll and a bunch of  
filters so I blindly followed IDE auto-complete.

Lesson learned.

On 10 April 2015 at 21:17, James Macdonald [james.macdonald@geofeedia.com](mailto:james.macdonald@geofeedia.com)  
wrote:

> I had a similar problem recently and solved it by moving my filter into a  
> filtered query (leaving the query as a match\_all), see documentation here  
> [Filtered Query | Elasticsearch Guide [1.5] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-filtered-query.html)  
> .
> 
> I am not certain why filters do not restrict the scope of the aggregates,  
> but queries do, but I suspect it interprets the filter (not wrapped in a  
> filtered\_query) as a post\_filter (  
> [http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html)).  
> Maybe someone else actually knows why.
> 
> Hope that helps,  
> James
> 
> On Fri, Apr 10, 2015 at 11:39 AM, James Green [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com)  
> wrote:
> 
> > I must be doing something stupid!
> > 
> > Using the Java client I can perform a search with a filter and iterate  
> > over the hits. I see exactly the right source documents.
> > 
> > If I add an aggregation, I see the expected keyAsText string but the  
> > docCount reflects the volume if the filter had not been applied.
> > 
> > I expected the aggregation to be restricted to the results within that  
> > filter?
> > 
> > Thanks,
> > 
> > James
> > 
> > --  
> > 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/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.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/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.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/CAMH6%2BaxhjdOQrfqy9Upsvnh%2B%2BgHmFDwqw%3DQqjHW2Z7DUm7BvJg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxhjdOQrfqy9Upsvnh%2B%2BgHmFDwqw%3DQqjHW2Z7DUm7BvJg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [April 15, 2015, 6:56am UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/5 "2015-04-15T06:56:12Z")

</div>

Which version are you using! The old post filter methods simply named  
filter, should have been removed, or at least deprecated.

Cheers,

Ivan  
On Apr 13, 2015 1:33 PM, "James Green" [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com) wrote:

> Indeed. I had used postFilter to add my filters. The documentation for  
> filters doesn't show how to use a query with a matchAll and a bunch of  
> filters so I blindly followed IDE auto-complete.
> 
> Lesson learned.
> 
> On 10 April 2015 at 21:17, James Macdonald [james.macdonald@geofeedia.com](mailto:james.macdonald@geofeedia.com)  
> wrote:
> 
> > I had a similar problem recently and solved it by moving my filter into a  
> > filtered query (leaving the query as a match\_all), see documentation here  
> > [Filtered Query | Elasticsearch Guide [1.5] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/1.5/query-dsl-filtered-query.html)  
> > .
> > 
> > I am not certain why filters do not restrict the scope of the aggregates,  
> > but queries do, but I suspect it interprets the filter (not wrapped in a  
> > filtered\_query) as a post\_filter (  
> > [http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-post-filter.html)).  
> > Maybe someone else actually knows why.
> > 
> > Hope that helps,  
> > James
> > 
> > On Fri, Apr 10, 2015 at 11:39 AM, James Green [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com)  
> > wrote:
> > 
> > > I must be doing something stupid!
> > > 
> > > Using the Java client I can perform a search with a filter and iterate  
> > > over the hits. I see exactly the right source documents.
> > > 
> > > If I add an aggregation, I see the expected keyAsText string but the  
> > > docCount reflects the volume if the filter had not been applied.
> > > 
> > > I expected the aggregation to be restricted to the results within that  
> > > filter?
> > > 
> > > Thanks,
> > > 
> > > James
> > > 
> > > --  
> > > 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/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxkmZVfDhkJW-bWPrRs5BMzTem-2zCQRWeF%2BLQCR2L5sA%40mail.gmail.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/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAABsnTbD0JgcpMCMWuzjVC1W3C-pt6pC6PJG0xT31O44MZQs%3DA%40mail.gmail.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/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X\_awGD3wR8B-vVZY-A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X_awGD3wR8B-vVZY-A%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X\_awGD3wR8B-vVZY-A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAMH6%2BaxDfHvCicw5rewNOAun5Vy2qZe8X_awGD3wR8B-vVZY-A%40mail.gmail.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/CALY%3DcQCy8fZvnKZpuGFJMWXvt9MFQdUQzFO8au77mZj7r3VW0A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCy8fZvnKZpuGFJMWXvt9MFQdUQzFO8au77mZj7r3VW0A%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:19am UTC](https://discuss.elastic.co/t/aggregation-not-limited-to-filter/23190/6 "2017-07-06T00:19:43Z")

</div>


