getAlgoliaFacetHits

Retrieves Algolia facet hits from multiple indices.

The getAlgoliaFacetHits function lets you query facet hits several Algolia indices at once.

Example#

import { getAlgoliaFacetHits } from '@algolia/autocomplete-js';
import algoliasearch from 'algoliasearch/lite';
const searchClient = algoliasearch(
'latency',
'6be0576ff61c053d5f9a3225e2a90f76'
);
getAlgoliaFacetHits({
searchClient,
queries: [
{
indexName: 'instant_search',
params: {
facetName: 'categories',
facetQuery: query,
maxFacetHits: 10,
},
},
],
}).then((facetHits) => {
console.log(facetHits);
});

Parameters#

See autocomplete-preset-algolia#getAlgoliaFacetHits.