atomic-facet
atomic-facet
This is for:
DeveloperA 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-facet
displays a facet of the results for the current query.
Introduction
A facet allows users to drill down inside a result set by filtering the result to certain field values. Adding an optional search box to a facet can help find specific values inside larger sets.
User Experience and Best Practices
Usage Notes
-
Checkboxes are the most commonly used display in most cases.
-
Boxes are multi-select, more visual, and able to present more values in a small space.
-
Links allow the user to select only one value at a time, and behave like a normal navigational link.
Guidelines
Don’t use boxes if your facet values are long, it won’t provide a good experience for your users and you risk truncating values. Place facets on the left side of the search page; this is the most natural place for them and is where users expect to see them. Positioning facets on the right side results in lower adoption and decreases the usability of the search page.
Use Cases and Examples
Facets are useful for large indexes because they provide multiple filters, one for every specific aspect of the content. Faceted navigation helps the user get an overview of the content available, helping them understand how to search for it.
Reference
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
|
|
Specifies an explicit list of If you specify a list of values for this option, the facet uses only these values (if they are available in the current result set). Example: The following facet only uses the
The maximum amount of allowed values is 25. Default value is |
|
|
|
|
Identifies the facet values that must appear at the top, in this order.
This parameter can be used in conjunction with the Facet values not part of the Example: The following facet will sort the If there are more than these 3 values available, the rest of the list will be sorted using
The maximum amount of custom sort values is 25. The default value is |
|
|
|
The required facets and values for this facet to be displayed. Examples:
|
|
|
|
|
|
Whether to display the facet values as checkboxes (multiple selection), links (single selection) or boxes (multiple selection). Possible values are 'checkbox', 'link', and 'box'. |
|
|
|
|
Specifies a unique identifier for the facet. |
|
|
|
|
The field whose values you want to display in the facet. |
|
|
|
|
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. |
|
|
|
|
Specifies how a result must match the selected facet values.
Allowed values:
- |
|
|
|
|
The sort criterion to apply to the returned facet values. Possible values are 'score', 'alphanumeric', 'alphanumericDescending', 'occurrences', and 'automatic'. |
|
|
|
|
Whether this facet should contain a search box. |
|
|
Shadow Parts
Part | Description |
---|---|
|
The button that resets the actively selected facet values. |
|
The clear button icon. |
|
The wrapper for the entire facet. |
|
The button that displays the label and allows to expand/collapse the facet. |
|
The label button icon. |
|
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. |
|
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 box wrapper. |
|
The show less results button. |
|
The show more results button. |
|
The icons of the show more & show less buttons. |
|
The facet value when display is 'box'. |
|
The selected facet value when display is 'box'. |
|
The facet value checkbox, available when display is 'checkbox'. |
|
The checked facet value checkbox, available when display is 'checkbox'. |
|
The facet value checkbox icon, available when display is 'checkbox'. |
|
The facet value checkbox clickable label, available when display is 'checkbox'. |
|
The facet value count, common for all displays. |
|
The facet value label, common for all displays. |
|
The facet value when display is 'link'. |
|
The selected facet value when display is 'link'. |
|
The facet values container. |
CSS Custom Content
Name | Description |
---|---|
|
Gap value for facet values, when the display is 'box' |
|
Number of facet values to display per row, when the display is 'box' |
|
Size of the checkbox. |
|
The size of the facet search clear icon. |
|
The size of the facet search icon. |