Aggregations on Subset of Queries

Hi,

I am wondering if it is possible to run aggregations on a subset of your queries. For example, I have facet filters where I want the counts to persist when someone clicks the various filters. The filters would obviously affect the documents that get returned but I want the counts to remain as if that filter were not applied. The counts would only change if someone changed their search in the free form text search.

Is this possible?

I think you are looking for the post_filter feature: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-request-post-filter.html
https://www.elastic.co/guide/en/elasticsearch/guide/master/_post_filter.html

Hope that helps

Perfect. Exactly what I need. Thanks!