Facet Count - change count from # variants to # products

Hi,

We are working on powering our Shopify Collections with Algolia. Regarding the ‘Facet Count’ feature, currently it shows a count of all available ‘variants’, i’m wondering if it’s possible to change this to a count of all available ‘products’.

Most of our products contain 50+ variants (sizes, colors, etc). So the variant count doesn’t provide our users with an accurate impression as to how many products are available with a certain facet filter selected.

For example, a facet filter selection might show a count of 200, but as we are using distinct based off product ID - it only shows 4 products (each with 50 variants).

Thanks

Actually, if you install the latest version of the Algolia front-end and use at the same time Show products instead of variants, you’ll see that facet counts are now actually hidden.

The reason for that is that, while some facets make sense at the product level, others don’t.
While showing facet counts for products can sometimes make sense (e.g. brands should probably not be different between 2 variants), a lot of others actually need facet counts for products.
For instance, the price ranges one will probably be different between variants, and you need to show all the available possibilities.
If you’re using faceting on variant options, the same applies.

Hence the best recommendation I can give you would simply to hide them or otherwise to provide approximations for them.

Hi,

We run a number if clothing stores where the number of variants doesn’t make sense to show but the number of styles is important. Hiding the count isn’t really a solution. We need to show the number of products so how can this be done?

Thanks,
Trevor

+1 on this please @Jerska
Can you please elaborate on

or otherwise to provide approximations for them.

What I meant there would be, instead of displaying:

Blue 1234

Display:

Blue ~1000

Example

I’ll expand a bit more on what I meant before with a simple example.
Let’s say you have a smartphone product with two variants, blue and red.
You also want to display on your website facet values for product_type and options.color.

With facet counts made at the product level

Type
----
* Smartphone    1

Color
-----
* Blue          1

Issue => We’ve lost a color.

With facet counts made at the variant level

Type
----
* Smartphone    2

Color
-----
* Blue          1
* Red           1

Issue => We have two Smartphones, but really, we’re selling only one.

Algolia offers an option (facetingAfterDistinct) that allows to select between both modes, but does not provide a way to make a mix of both (i.e. specify which facets should be done before distinct, and which ones after). As a result, the only really reasonable option is to use option 2 (at the variant level) to have all options, but not show counts at all.

I hope this clarifies a bit more the situation. :slight_smile:

2 Likes