# How to combine elasticsearch aggregation results to category navigation

**URL:** https://discuss.elastic.co/t/how-to-combine-elasticsearch-aggregation-results-to-category-navigation/24642
**Category:** Elasticsearch
**Created:** [June 30, 2015, 4:15pm UTC](https://discuss.elastic.co/t/how-to-combine-elasticsearch-aggregation-results-to-category-navigation/24642 "2015-06-30T16:15:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elastiq](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@elastiq](https://discuss.elastic.co/u/elastiq)
#### Post date: [June 30, 2015, 4:15pm UTC](https://discuss.elastic.co/t/how-to-combine-elasticsearch-aggregation-results-to-category-navigation/24642/1 "2015-06-30T16:15:34Z")

</div>

Let's say I have infinite hierarchical category menu achieved by some other datastore (In my case should be mongodb). Now I want to add faceted filter feature, I want the category to be recalculated as the user applies a filter. Should hierarchical menu be stored in elasticsearch or should I take two queries from two databases and combine them somehow in my application. I see no easy way I might have a wrong thinking since I am new to elasticsearch. Also I read elasticsearch shouldn't be used as primary database so category should not be stored in it I guess.

-Here I gave two cases as an example to explain better  
Case 1: If I go to automobile category it contains lots of sub-categories as car brands and in parentheses it has item counts. As Shown in image below  
Also this is the link [http://www.sahibinden.com/otomobil](http://www.sahibinden.com/otomobil)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/0d9598325e97c4c026bd395a43736d7b044ac3b2.png)

Case 2: The link is here [http://www.sahibinden.com/otomobil?price=450001-500000](http://www.sahibinden.com/otomobil?price=450001-500000)  
As I applied price range between 400k&500k sub categories of Otomobil (brands) greatly reduced and their counts as well.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e85d584286e9d84f33161e2bf1532dcd126886bf.png)

How do I achieve such kind of functionality

---

<div class="post-metadata">

### Author: ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://discuss.elastic.co/u/basti)
#### Post date: [March 8, 2016, 7:19pm UTC](https://discuss.elastic.co/t/how-to-combine-elasticsearch-aggregation-results-to-category-navigation/24642/2 "2016-03-08T19:19:14Z")

</div>

@elastiq: did you found a solution? I am just searching for a solution to this problem also....

---

<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 5, 2017, 11:10pm UTC](https://discuss.elastic.co/t/how-to-combine-elasticsearch-aggregation-results-to-category-navigation/24642/3 "2017-07-05T23:10:13Z")

</div>


