Indexing Multiple Product Images

Hey there,

I see that this has been covered previously, and that Algolia only indexes a single image per variant. However, this is pretty standard Shopify functionality and I’m probably not alone in thinking there should be an effort to achieve some parity here.

First off, I love Algolia and it does what it does and it does it better than anyone else. I’ve used it on multiple projects and have never really had major issues. I this case, it just seems slightly limiting.

It’s probably not feasible to index all product images (up to 250 I believe), but perhaps doing something similar what Shopify does and accessing the variant’s assigned image at featured_image and 2-5 others on an images array would be easier to implement.

Is there any plan to implement this option? Maybe as an opt-in within the app settings in Shopify?

Cheers and thanks!

1 Like

Hi there! Thanks for your kind words and your feedback. Those are greatly appreciated.

Looking at the Product Variant documentation, there seems to be only one image per variant.
There definitely are multiple images at the Product level itself though.

The issue here is that we’re indexing variants.
And in those variants, we’re already putting some product specific information.
Until now, everything is fine.

But it gets trickier to understand that in those variants, we’re actually putting some product specific information about its own list of variants. So a variant record in Algolia will contain variants_min_price and variants_max_price, information which is only useful when we’re deduplicating at search time using distinct (actual feature used by the Show products instead of variants option). Confused enough? :slight_smile:

As you can see, the schema in https://community.algolia.com/shopify/index-schema.html is already pretty complex.
I’d like, as much as possible to avoid complexifying it more and hence complexifying the UI.

Another thing to consider is that a record has a maximum size of 20KB.
A lot of it is already taken by the description, and we need to be careful with fields that might take a big amount of space.

I’m afraid that for now, we’re talking too much about an edge case for us to implement this.

All of this said, I’m sure you’re not alone who’d like this.
If the feature gets asked by many other people, we’ll definitely consider adding an option.

Finally, if you really want the feature, you could have a script which would periodically put those images as named tags: https://community.algolia.com/shopify/named-tags.html .
If you use multiple times the same key, it will create an array of elements.
You’ll need to keep in mind the record size limit though!

Another alternative would be to, on hover, do an AJAX request to https://your-store.myshopify.com/products/your-product-handle.json .
This has all the information needed for you to be able to show the different variants, with their respective images.

1 Like