Signature
About this widget
FacetList is a filtering component that displays facets and lets users refine their search results by filtering on specific values.
Requirements
Theattribute provided to the widget must be in attributes for faceting,
either on the dashboard or using the attributesForFaceting parameter with the API.
Examples
Create facet list
CreateFacetList with HitsSearcher
and FilterState:
Dart
Display facets
Get selectable facet changes by listening tofacets submissions.
Call toggle to select or deselect a facet value:
Dart
Dispose
Calldispose to release underlying resources:
Dart
Parameters
The
FilterState that holds your filters.The attribute to filter.
Filters operator, which can either be
FilterOperator.and or FilterOperator.or.Use filters or facet filters
for more complex result refinement.Whether the list can have
SelectionMode.single or SelectionMode.multiple selections.When
true, the selection will be kept even if it doesn’t match current results anymore.Fields
A stream of facets with their selection status.
Dart
FilterEventTracker instance responsible for sending Insights events related to user interactions with facets,
such as clicking, viewing, and converting filters. With the eventTracker,
you can track user’s behavior, which can help you personalize their search experience.Dart
Methods
toggle
Select or deselect the provided facet value depending on the current selection state.
Dart
dispose
Releases all underlying resources.
Dart