Skip to main content

About this widget

This component is handled by objects that implement the Searcher interface. These objects manage the search session and process each as it occurs. Algolia provides you with several out of the box searchers to help build your InstantSearch experience:
  • HitsSearcher: searches a single .
  • FacetSearcher: searches for values.
  • MultiSearcher: searches in multiple indices. This is useful for a federated search, or query suggestions search experience.

Explore example code

Browse the Searcher example code on GitHub.

Examples

Instantiating a HitsSearcher:
Kotlin
Instantiating a FacetSearcher:
Kotlin
Instantiating a MultiSearcher:
Kotlin

HitsSearcher

String
required
The index to search into.
Kotlin
SearchParamsObject
default:"SearchParamsObject()"
A .
Kotlin
Boolean
default:false
Flag defining whether the automatic hits view Insights sending is enabled.
The default value was true until version 3.3.1.
Kotlin
String
The user token assigned to automatically send click and conversion events in the HitsSearcher component. If not explicitly set during initialization, the HitsSearcher generates and assigns a default user token.
RequestOptions
default:"null"
RequestOptions that apply to the search.
Kotlin

FacetSearcher

String
required
The index to search into.
Kotlin
String
required
An attribute to search facet values for.
Kotlin
SearchParamsObject
default:"SearchParamsObject()"
A query used to perform the search.
Kotlin
RequestOptions
default:"null"
RequestOptions that apply to the search.
Kotlin

MultiSearcher

MultipleQueriesStrategy
default:"None"
The strategy of the query.Can be one of the following values:
  • None. Execute the sequence of queries until the end. This is recommended when each query is of equal importance, meaning all of all queries need to be returned.
  • StopIfEnoughMatches. Execute queries one by one, but stop as soon as the cumulated number of hits is at least hitsPerPage. This is recommended when each query is an alternative, and where, if the first returns enough records, there is no need to perform the remaining queries.
Kotlin
RequestOptions
default:"RequestOptions()"
RequestOptions that apply to the search.
Kotlin

Methods

Triggers the search and returns a search response.
Kotlin
Triggers the search. Notifies all listeners of the results.
Kotlin
Cancels the ongoing search requests.
Kotlin
Sets the query to the string provided.
Kotlin

Events

Triggered when the status of the search request is changed.
Kotlin
Triggered when a new response has arrived.
Kotlin
The deserialize extension is deprecated in 4.x. Consider parsing hits directly from SearchResponse.hits, which returns List<Hit> from the Algolia client.
Triggered when an error was encountered during a search request.
Kotlin
Last modified on July 22, 2026