atomic-category-facet (Deprecated)
atomic-category-facet (Deprecated)
A facet is a list of values for a certain field occurring in the results, ordered using a configurable criteria (for example, number of occurrences).
An atomic-category-facet
displays a facet of values in a browsable, hierarchical fashion.
Introduction
A facet allows users to drill down inside a result set by filtering the result to certain field values. Category Facets are browsable facets that display values in a hierarchical fashion, narrowing the available options through offering alternative starting points and sub-categories.
The Category Facet is especially useful when making fundamental decisions on a starting point in a search or browsing session. For example, if the starting point was Clothing, available options to choose from might include t-shirts, sweaters, brands, sales, new arrivals, etc. Each one of those options would then offer a new list of surrogate categories.
Best Practices
Usage Notes
-
A Category Facet requires a multi-value field whose values are formatted hierarchically. The facet will determine the filter to apply based on the current selected path of values. This can offer a powerful navigational experience, quickly leading a user to relevant results.
This component uses
;
to separate individual values, and the character that’s defined with thedelimiting-character
attribute to separate hierarchical levels within each value. We recommend setting this attribute to|
instead of using the default, which is;
. The following is an example of the recommended hierarchical formatting:clothing; clothing|sale; clothing|sale|shoes; clothing|sale|shoes|kids; clothing|sale|shoes|kids|sneakers;
-
It’s only possible to select one value at a time in a category facet. This is because they’re meant to ease navigation through their hierarchically organized content, as opposed to applying multiple hierarchical filters.
Guidelines
It’s best practice to have hierarchies at five levels or less in depth.
Use Cases and Examples
On an ecommerce website, a user may want to start browsing by the category Men, and then narrow their results to Bottoms, then further to Pants, etc. Instead of selecting the facet value directly, this allows them to navigate hierarchically and determine the right starting point.
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
|
|
The base path shared by all values for the facet. Specify the property as an array using a JSON string representation:
Specifying the property as a comma separated string is deprecated. |
|
|
|
|
The character that separates values of a multi-value field. Note: If you use the example formatting for the associated multi-value field, you must set this value to |
|
|
|
The required facets and values for this facet to be displayed. Examples:
|
|
|
|
|
|
Specifies a unique identifier for the facet. |
|
|
|
|
The field whose values you want to display in the facet. |
|
|
|
|
Whether to use basePath as a filter for the results. |
|
|
|
|
Whether to exclude the parents of folded results when estimating the result count for each facet value. |
|
|
|
|
The heading level to use for the heading over the facet, from 1 to 6. |
|
|
|
|
The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
Note: A high injectionDepth may negatively impact the facet request performance.
Minimum: |
|
|
|
|
Specifies whether the facet is collapsed. When the facet is the child of an |
|
|
|
|
The non-localized label for the facet.
Used in the |
|
|
|
|
The number of values to request for this facet. Also determines the number of additional values to request each time more values are shown. |
|
|
|
|
The sort criterion to apply to the returned facet values. Possible values are 'alphanumeric' and 'occurrences'. |
|
|
|
|
Whether this facet should contain a search box. When "true", the search is only enabled when more facet values are available. |
|
|
Shadow Parts
Part | Description |
---|---|
|
The non-clickable active parent. |
|
The "View all" button displayed first along the parents. |
|
The back arrow displayed before the clickable parents. |
|
The wrapper for the entire facet. |
|
The button that displays the label and allows to expand/collapse the facet. |
|
The label button icon. |
|
A facet value with no child value |
|
The highlighted query inside the matches labels. |
|
The label indicating there are more matches for the current facet search query. |
|
The label indicating there are no matches for the current facet search query. |
|
A facet value with children values |
|
The clickable parent button. |
|
The parent values container. |
|
The placeholder shown before the first search is executed. |
|
The button to clear the search box of input. |
|
The highlighted query inside the facet values. |
|
The search box submit button. |
|
The search box input. |
|
The search result value. |
|
The search result path. |
|
The search results container. |
|
The search box wrapper. |
|
The show less results button. |
|
The show more results button. |
|
The icons of the show more & show less buttons. |
|
The facet value count. |
|
The facet value label. |
|
The child facet value. |
|
The facet values child container. |
CSS Custom Content
Name | Description |
---|---|
|
The size of the facet search clear icon. |
|
The size of the facet search icon. |