When you enable “Show products instead of variants” in the Algolia Shopify app, it activates the distinct feature on the id
attribute on your Algolia index.
The id
attribute represents the “product Id” attribute in your Shopify store, so the distinct feature will use this attribute to limit the number of returned records that contain the same value in that attribute. If your 'Product A' has 5 different sizes, your search will return only the single most relevant record; the other variants that share the same id
("product Id") will not be displayed.
Facets will return the facet values that appear in the search results, so if the search results are deduplicated by the distinct
parameter, your facets will only display the facet values of the returned variant.
While this can be accomplished in non-Shopify implementations of Algolia by setting the facet filter as a non-afterDistinct
faceting attribute (as described in this documentation), there is currently no custom hook to modify the default distinct
behavior as it relates to faceting in the Algolia Shopify app.
Although we do not have an ETA at this time, our product team have added this functionality to the roadmap for a future release.