The Algolia AI Search & Discovery app for Shopify indexes your catalog at the variant level. Each product variant is stored as a separate Algolia record, and a full product reindex generates indexing operations equal to the number of published variants in your store.
However, the number of results returned by a search doesn’t always match the total number of variant records. This usually happens when your index is configured to group variants with Algolia’s distinct feature.
When you configure:
an
attributeForDistinct(for example, a product ID), andenable
distinct,
Algolia treats all records that share the same attributeForDistinct value as a group and returns only one or a few records per group. In this mode:
attributeForDistinctdefines the groups (all variants for the same product).distinctcontrols how many records from each group are included in the results (for example, one record per product whendistinct = 1).The
nbHitsfield in the search response reflects the number of groups, not the total number of underlying variant records, whendistinct > 1.
As a result, a search that matches all your product variants (including an empty query) can return a much lower result count than the total number of variant records stored in the index—because multiple variants are grouped under a single result.
If you want to control whether shoppers see one result per product or per variant:
Configure variant grouping using
attributeForDistinctanddistincton the Algolia index, following the general guidance on deduplication and grouping.For Shopify stores, you can manage how products and variants appear in search from the Algolia AI Search & Discovery app (for example, using options that control whether to show products instead of variants) rather than changing these settings directly on the Algolia dashboard.
This behavior is expected whenever your index groups variants by a shared attribute value. To see the full raw number of variant records, you can temporarily run a search on the same index with distinct disabled.