getAlgoliaFacets function lets you query facet hits from one or several Algolia indices.
Using getAlgoliaFacets 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
JavaScript
Parameters
SearchClient
required
The initialized Algolia search client.
FacetQuery[]
required
The queries to search for.
function
Type definition
JavaScript
Returns
The function returns:TypeScript