- Variant-level records: one Algolia record for each product variation.
- Product-level records: one Algolia record for each base product. The record contains all variants.
- Variation-group-level records: one Algolia record for each variation of a specific attribute,
generally the
color. Each record contains variations sharing this attribute value.
Record structure examples
The following example shows records for a t-shirt in two colors. Each color comes in two sizes. With the variant-level records model, each variant is a separate record:JSON
variants array.
Each array item corresponds to a unique variant:
JSON
variants array.
Each array item corresponds to a unique variant:
JSON
Choose your record model
When choosing between the three indexing models, consider whether you use Algolia AI or merchandising features. Use the variation-group-level or product-level record model if you use Algolia AI or merchandising features. These models can work better when your variants look alike:-
Algolia groups click and conversion events from each variant
by
objectID, meaning by base product or by variation-group. This lets Algolia re-rank or personalize results at the product or variation-group level, not just for specific variants. - Merchandising at the product-level or variation-group-level is simpler when you have many variants. For example, you can promote or hide products or variations rather than individual variants.
- Search analytics groups results by product or variation, which makes them simpler to analyze.
- Results match the most relevant variant directly. For example, a search for “red shoes” returns only variants with “red” in their data. In contrast, the product model requires more frontend work to display the correct variant.
-
Faceting is more accurate.
A like
color: green AND size: 40returns only matching variants, not entire products with partial matches. In the product model the two conditions can match different variants, so the results can include products where no single variant satisfies both. See Filters and arrays of objects. - You can update individual variant attributes, such as price or stock. The product model requires resending the full list of variants, because it doesn’t support partial updates.
Capabilities by record model
Average record size for the variant-level model
The average record size for the variant-level model depends on what you want to show on your results, for example, if you want to include color swatches or images carousels. To display those, each of your variant records needs to have information about their siblings, which increases the average record size.Results display
Group records per product
Depending on your desired end-user experience and catalog size, showing one result per product, instead of listing each variant separately, can offer a cleaner, friendlier interface. With the product-level record model, you get one result per product by default. The variant-level model requires using the distinct feature to group variants under a single result. To do this, include a shared product ID in each variant record and set the distinct parameter on that attribute:JSON
- By default, you get one result per variation (for example, one per color).
- Or you can use the distinct feature the same way as for the variant-level model and display one result per product.
Facets
The variant-level record model lets users refine results. In this model, Algolia returns only the variants that match a selected , with no extra frontend logic required. This also works well for the variation-group-level model when it’s based on color. Images are often the same for all variants of a given color, so a record’s variants tend to share the same image. This means you don’t need extra frontend logic here either. In contrast, the product-level model always returns the entire product, including all variants. To display only the matching variants, you need to post-process the search results in your InstantSearch code:JavaScript