# Stuck migrating from facets to aggregations - no equivalent of top level "filter"?

**URL:** <https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912>\
**Category:** Elasticsearch\
**Created:** [February 3, 2016, 8:56pm UTC](https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912 "2016-02-03T20:56:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [February 3, 2016, 8:56pm UTC](https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912/1 "2016-02-03T20:56:56Z")

</div>

I was trying to migrate my application from ES 1.7 replacing facets with aggregations and stuck on top level `filter` being removed. With 1.x elastic it was possible to use `filter` and `query` where filter would only apply to hits but not to facets. Looks like in ES 2.2 and with aggregation there is no similar functionality. It really is central to all my navigation and faceting combined with search and filtering paradigm and I do not see any solution for my issue - I need to be able to get hits and facets (aggs) in one query where hits would have query and filter applied to it while facets only query

I would appreciate your advice

thanks  
alex

---

<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:** [February 3, 2016, 10:16pm UTC](https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912/2 "2016-02-03T22:16:31Z")

</div>

The filter has been renamed post\_fitler:  
[https://www.elastic.co/guide/en/elasticsearch/reference/2.x/search-request-post-filter.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.x/search-request-post-filter.html)

Previously, the term "filter" was ambiguous, so now it always applies  
pre-query.

---

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [February 3, 2016, 11:02pm UTC](https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912/3 "2016-02-03T23:02:46Z")

</div>

Thanks Ivan! I glanced over post query topic without reading it but for some reason assumed it is about rescoring ☹ silly me

---

<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:19pm UTC](https://discuss.elastic.co/t/stuck-migrating-from-facets-to-aggregations-no-equivalent-of-top-level-filter/40912/4 "2017-07-05T23:19:07Z")

</div>


