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.
Example
This example uses the function along with thealgoliasearch API client.
JavaScript
When using
getAlgoliaFacets and getAlgoliaResults with the same search
client in different sources or plugins, Autocomplete batches all queries into
a single network call to Algolia. If you’re using the same search client for
different sources or plugins, make sure to use the same instance to leverage
the internal cache and batching mechanism.Parameters
The initialized Algolia search client.
The queries to perform.
Type definition
JavaScript
Returns
The function returns:TypeScript