Table of Contents

Facets

Facets are a type of search filter used to refine a query result from frontend - here a product query: Facets Technically, a facet is a mapping between a parameter and a list of values from a field in the index, e.g. Brand. Selecting one of the values in the left-side menu then passes the value to the query via the parameter, and the filtered query result is then returned to frontend.

To use a facet, include it on the Product Catalog or Product Catalog for ViewModel app used to show the product list. You will then have access to the facet groups and facets in your templates and can render them in frontend.

Creating facets

Since facets are tied to a specific query, they are created under that query

  1. Navigate to Settings > System > Repositories
  2. Fold out the repository and index you want to create facets for
  3. Find the appropriate query - typically the one used to publish products to frontend
  4. Open the context menu and click Add facet group AddFacetGroup
  5. Provide a name
  6. Save

Fold out the query in the tree and click the facet group to open the interface where you create facets: AddFacets To add a facet:

  1. Click Add new facet
  2. Provide a name
  3. Select a facet type
    • Field facets create a facet option for each value found in a particular field in the index
    • List facets allows you to group field values under a common label (“Spring colors”)
    • Term facets create facet options from the 2048 most frequent values found for the selected index field
  4. Select the query parameter to pass values to
  5. Specify a render type
  6. Save

The Show-settings on a facet allows you to show this facet only under certain conditions, such as if another facet has a value. To set that up on the facet:

  1. Under Show select Conditionally
  2. Select a query parameter
  3. Choose HasValue or HasSpecificValue as appropriate
  4. If HasSpecificValue is selected provide a value
  5. Save
To top