# ElasticSearch Filter by Aggregation Result

**URL:** <https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847>\
**Category:** Elasticsearch\
**Created:** [July 18, 2015, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847 "2015-07-18T11:33:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elm/32/3782_2.png) [@elm](https://discuss.elastic.co/u/elm)\
**Post date:** [July 18, 2015, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847/1 "2015-07-18T11:33:11Z")

</div>

Hello, I don't want to cross post, but since this just launched and moved from the Google Groups I am not sure what's the best place to ask questions is at the moment. I posted on StackOverflow one [http://stackoverflow.com/questions/31471365/elasticsearch-filter-by-aggregation-result](http://stackoverflow.com/questions/31471365/elasticsearch-filter-by-aggregation-result).

As a side note: Is this place the right one or do you have a preference for certain type of questions to be here (e.g. more core related) and others on SO (more general related).

Thanks,  
Elmar

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 20, 2015, 6:50am UTC](https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847/2 "2015-07-20T06:50:35Z")

</div>

First to answer your actual query, in 1.4 there is nothing to filter the buckets returned by the aggregations on the client side. Coming in 2.0 with the new pipeline aggregations there is the [`bucket_selector` aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-pipeline-bucket-selector-aggregation.html) which will allow you to do this kind of filtering though.

And to your side note question, yes this is the right place to be asking all types of questions about using, developing maintaining etc. Elasticsearch. These forums are indeed fairly new but they are also pretty active.

HTH

---

<div class="post-metadata">

**Author:** ![elm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elm/32/3782_2.png) [@elm](https://discuss.elastic.co/u/elm)\
**Post date:** [July 20, 2015, 9:12am UTC](https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847/3 "2015-07-20T09:12:27Z")

</div>

Thanks, good to know, will give them a test in 2.0 when I have time but for now stick with aggregating it on the client side.

---

<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:00am UTC](https://discuss.elastic.co/t/elasticsearch-filter-by-aggregation-result/25847/4 "2017-07-06T00:00:24Z")

</div>


