Signature
About this widget
This component handles search requests and manages search sessions. TheHitsSearcher
component has the following behavior:
- Distinct state changes (including initial state) will trigger a search operation
- State changes are debounced
- On a new search request, any previous ongoing search calls will be cancelled
HitsSearcher
. Searches a single index.FacetSearcher
. Searches for facet values.MultiSearcher
. Aggregates the hits and facet searchers. This is useful for building a federated search, or query suggestions.
Examples
- Create a
HitsSearcher
- Update search state with
query
andapplyState
- Listen to search
responses
and build the UI dispose
of underlying resources
Dart
HitsSearcher
The ID of your application.
Dart
Your application’s Search-only API key.
Dart
The index to search into.
Dart
Initial search state.
Dart
Whether disjunctive faceting is enabled.
Dart
Search operation debounce duration.
Dart
Fields
Stream of search responses.
Dart
Stream of search states.
Dart
Instance responsible for handling and sending user events related to search interactions,
such as clicks, conversions, and views.
These events help to personalize the user’s search experience by providing insights into user behavior.
eventTracker
is automatically integrated with the HitsSearcher
to track events when users interact with the search results.Dart
Methods
query
Triggers a search operation with given search query.
Dart
applyState
Applies a search state configuration and triggers a search operation.
Dart
dispose
Releases all underlying resources
Dart
FacetSearcher
The ID of your application.
Dart
Your application’s Search-only API key.
Dart
The index to search into.
Dart
The facet name to search into when doing search for facet values.
Dart
Initial facet search state.
Dart
Search operation debounce duration.
Dart
Fields
Stream of search responses.
Dart
Stream of facet search states
Dart
Methods
query
Triggers a search operation with given search query
Dart
applyState
Applies a search state configuration and triggers a search operation
Dart
dispose
Releases all underlying resources
Dart
MultiSearcher
MultiSearcher
lets you simultaneously search for hits and facet values in different indices of the same Algolia application.
It instantiates and manages HitsSearcher
and FacetSearcher
instances. Once created, these searchers behave like their independently instantiated counterparts.Dart
Methods
dispose
Releases all underlying resources
Dart
addHitsSearcher
Adds a new
HitsSearcher
to the multi-searcher.Dart
addFacetSearcher
Adds a new
FacetSearcher
to the multi-searcher.Dart