getAlgoliaResults function lets you query one or several Algolia indices.
Using getAlgoliaResults lets Autocomplete batch all queries using the same search client into a single network call,
and thus minimize search unit consumption.
It also works out of the box with the components
exposed in templates.
If you’re using
autocomplete-js,
you don’t need to import the preset separately.
The package includes all Algolia utilities, with the appropriate user agents and virtual DOM support.Installation
First, you need to install the preset.JavaScript
script element:
HTML
Example
This example uses the function along with thealgoliasearch API client.
JavaScript
Parameters
SearchClient
required
The initialized Algolia search client.
MultipleQueriesQuery[]
required
The queries to perform.
function
Type definition
JavaScript
Returns
ThegetAlgoliaResults function returns:
TypeScript