HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

Facets group documents based on criteria, such as specific terms or date ranges. 

A filter facet returns a count of search results that match a filter. The filter can be an expression used with the [Filter method](🔗), ranging from a single criterion to complex criteria of multiple sub-criteria.

To request a filter facet, use the `FilterFacet` method, which has two parameters: name and filter or filter expression. You retrieve the resulting facet from the search results object using a method with the same name but with only a name parameter. The returned object has a single property, `Count`, which is the number of documents that match the search query and filter.

The following example shows a sample search for products that requests and retrieves the value from two filter facets.