When building a Search experience on your Shopify store, there might be times where it is necessary to add search parameters to fine tune your Search results.
A typical example of search Parameters are filters, optionalFilters, facetingAfterDistinct or ruleContexts. These kinds of search parameters can help you to refine your results and achieve relevance objectives.
To pass search parameters on InstantSearch, you can use our hook beforeISStartAddWidgetArray, which will allow you to leverage our configure widget.
algoliaShopify.hooks.registerHook('beforeISStartAddWidgetArray', function() {
// Please be aware not all widgets are available
const { configure } = window.algoliaShopify.externals.widgets;
const configureWidget = configure({
"facetingAfterDistinct":false
})
console.log(configureWidget)
return [configureWidget];
});