This article explains how Klevu manages product variants.

There are different types of products (e.g. simple, bundle, etc) and one of them is a Configurable (as known in Magento). A configurable product would usually have two or more variants associated with it and these variants are characterised by different attribute values associated with them(e.g. colour, size, material etc).

You can imagine a shirt that is available in three different colours (e.g. white, yellow and green) where each of these colours is available in three different sizes (e.g. Small, Medium, Large). In total, you can think of 9 variants of this product (i.e. white small, white medium, white large, yellow small, …, green large)

Regardless of the platform, these variants are usually not visible on their own on the category pages but when the configurable product is selected its variant options are displayed to the customer on the product page. This is where the customer is asked to choose the relevant options of variants and buy one or more of the same.

How are the variants submitted to Klevu search?
At Klevu, when dealing with configurable products, we collect data (e.g. id, name, image, attributes etc) of each variant separately and index it independently as well.  At the same time, we index each variant’s itemGroupID (i.e. the ID of the configurable product), which must remain the same for all the variants of a same configurable product.
Does Klevu show all the variants in search results?

No.  Eventhough, Klevu indexes all variants of a configurable product, when displaying the search results, it shows only one of the variants to the customer. Here, the variant to be shown is decided based on the query term submitted by the customer and the relevancy score calculated by Klevu’s algorithm.

In the example of the shirt given above, if a customer searches for the keyword “shirt”, it doesn’t really matter which of the nine variants Klevu shows to the customer — as long as the variant is one of their most selling variants or the one that has the highest relevancy score in the backend. For example, if the query is “white small shirt“, we would show only the white variant that is available in the small size.

If Klevu shows one of the variants, how would a customer know there are others available as well?

There are two places where the customer is informed about the other variants of the same product.

First, next to the product name in the search results, we show a text with the exact number of other variants available for that query. For example, if the query was “shirt”, Klevu shows the text “8 variants” next to the product name. Similarly, if the query was “white shirt” or “small shirt”, Klevu would show “2 variants” next to the product name.

Second, when the facets are displayed, Klevu shows the relevant options available and let the customer choose whichever they like. For example, if the query is “shirt”, Klevu shows two filters, colour with the values white, green and yellow and size with the values small, medium and large. Similarly, if the query is  “white shirt”, only the size filter will be visible with the three options small, medium and large.

Depending on the selection of these values by the customer, the variant in the results will be displayed.

Is it possible to use the image of a configurable product?
By default, Klevu shows the image of a variant selected to be displayed in search results. In case the variant doesn’t have its own image, Klevu uses the image of its configurable product. In case you want us to use the image of configurables (instead of the variant images), that too is possible. Please look at the documentation of the relevant platform to find out how to do it.
Is it possible to index only the configurable products?
Out of the box, it isn’t possible to do so for Magento and Shopify. If you like to do it, we consider that as a custom store specific requirement and may be able to provide a patch.  For the custom stores, where the data is submitted via feed, it is possible, please let us know.