# To apply filters to the aggregation

**URL:** <https://discuss.elastic.co/t/to-apply-filters-to-the-aggregation/102280>\
**Category:** Elasticsearch\
**Created:** [September 29, 2017, 4:13pm UTC](https://discuss.elastic.co/t/to-apply-filters-to-the-aggregation/102280 "2017-09-29T16:13:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11114](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11114/32/8524_2.png) [@11114](https://discuss.elastic.co/u/11114)\
**Post date:** [September 29, 2017, 4:13pm UTC](https://discuss.elastic.co/t/to-apply-filters-to-the-aggregation/102280/1 "2017-09-29T16:13:07Z")

</div>

How can I make I have aggregation at the prices, example

range | count  
0 - 10000 | 100  
10000 - 20000 | 20

If you choose 0 - 10000 then the filter will apply and in the aggregation will not be 10000 - 20000 how to do it ?  
I need to remained all buckets Need to do separate queries ?

Example booking [http://joxi.ru/KAgP808h4d490r](http://joxi.ru/KAgP808h4d490r)

Thank you!

---

<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:** [October 27, 2017, 4:13pm UTC](https://discuss.elastic.co/t/to-apply-filters-to-the-aggregation/102280/2 "2017-10-27T16:13:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
