# Aggregation of possibly added buckets

**URL:** https://discuss.elastic.co/t/aggregation-of-possibly-added-buckets/150529
**Category:** Elasticsearch
**Created:** [October 1, 2018, 8:20am UTC](https://discuss.elastic.co/t/aggregation-of-possibly-added-buckets/150529 "2018-10-01T08:20:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Johnz86](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Johnz86](https://discuss.elastic.co/u/Johnz86)
#### Post date: [October 1, 2018, 8:20am UTC](https://discuss.elastic.co/t/aggregation-of-possibly-added-buckets/150529/1 "2018-10-01T08:20:31Z")

</div>

I need a functionality similar to shop filter, which shows the possible amount of added documents after the selection of one value in a filter. Example:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/5/a549d1b4e6524a2ec6b8f6bb2ad47e6969339797.png)  
Each filter item is one bucket value of a field, which can be used for a query. Selection of items from different filters, creates a bool must query between two fields. I am able to get the basic count of documents with simple aggregation, when there is no query. I am unable to create a aggregation, which would show all possible buckets, that would be added, if item was added to the query.  
Is there any feature/example/plugin that can be used to find possible added buckets?

---

<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 29, 2018, 8:20am UTC](https://discuss.elastic.co/t/aggregation-of-possibly-added-buckets/150529/2 "2018-10-29T08:20:34Z")

</div>

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