Sometimes you want to have a facet calculated on just a subset of the result or have multiple facets each being calculated on a different subset of the result. To enable this I’ve created a small extension project to the Episerver Find API, FacetFilter2Find, that enables passing a filter to TermsFacetFor(…) that will filter the result set when calculating the facet.
How to use the FacetFilter2Find extension
To use it you simply pass a filter when requesting the facet:
and fetch the resulting facet:
In order to specify multiple facets on a single field, each having a different filter, one must specify a custom name:
and fetch the resulting facets:
I hope you may find this useful when making your site awesome with EPiServer Find!