Facets are filter lists that let people narrow search results by values such as category, content type, or year. Facets are built from values in your indexed fields and update as the set of matching results changes.
Faceting is a Profile-level feature. You can configure different facets for different Search Profiles or apply the same Faceting configuration to multiple Search Profiles.
See the Faceting video for a brief demonstration.
Before You Configure Facets
Make sure the field you want to use is already indexed and supports faceting.
For categorical or text-like facets, use a String field when possible. String fields preserve complete values. Text fields are tokenized, so a multi-word value can be split into separate terms and may be transformed during indexing.
For more information about how field types affect facets, see Field Types.
Configure Facets
- In Site Search, go to Configurations > Basic Configurations > Faceting.
- Check Enable faceting.
- Use Field Type to narrow the field list. For categorical or text-like facets, String is the recommended field type.
- Select an index field from Facet Field.
- Enter a user-friendly Label.
- Set Max Facet Values and choose how to sort the values:
- Count
- Alphanumeric, ascending or descending
- Click (+) to add the facet.
- Select a facet and use Move Up or Move Down to change its position. Remove a facet if you no longer want it displayed.
- Click Save Draft to save your changes without publishing them, or Publish to make the configuration active.
When you save a draft, Site Search shows a blue dot in the navigation menu for pending changes to the current App, language, and Search Profile. The configuration page also displays the current draft or published status.
Validate Facets
After you publish your changes:
- Click Preview in the top navigation.
- Run a broad query, such as
*. - Select values from each facet.
- Confirm that the results and facet counts update as expected.
If you use the Hosted Search Experience, click Regenerate, then View to test the updated search experience.
For time-based values such as months or days of the week, UI Kit implementations can use beforeFacetsRender to reorder facet values chronologically before rendering.
Apply Facets to Multiple Search Profiles
When your App has multiple Search Profiles, you can apply the Faceting configuration to one or more Search Profiles.
- Make your Faceting changes.
- Click Save Draft or Publish.
- In Select Profile(s), choose:
- the current Search Profile
- multiple Search Profiles
- all Search Profiles
- Complete the save or publish action.
Note: Applying Faceting changes to multiple Search Profiles overwrites the entire Faceting configuration in each selected Search Profile.
For more information, see Multi-Site Search Management.
Troubleshoot Facets
- A field is missing: Confirm that the field exists in the index and that the selected Field Type isn't hiding it. Then click Reload Schema. If the field still doesn't appear, verify that its schema supports faceting.
- A multi-word facet value appears as separate terms: Check the field type. For categorical or text-like values, use a String field instead of a tokenized Text field.
- A configuration or label change isn't visible: Make sure you've published the change. If you're testing with Hosted Search Experience, regenerate it before viewing.
- A value changed in your source content but the old value still appears: Reindex or re-ingest the changed content. New facet values don't appear until the updated content is indexed.