Unfortunately, there’s no current support as of today, in the integration, of the relationship between Products and Collections with Algolia. This means that replacing Shopify’s collection page with Algolia is not supported.
The relationship would be flowing both ways : we need to know the amount of products of a collection, and we need to have the list of collections of a product.
This thread will help clarify why and list what our integration users would like to implement with this.
- Our indexing is real-time.
- To that end, we’re using Shopify webhooks to keep track of the updates.
- Webhooks don’t include a reason as for why they were triggered
- Webhooks only contain the object they were triggered on
- => When a product is updated, we don’t know if its change would make it be part or removed of a Smart collection
- => So we have, on each product update, to do one API call to list all of its associated collections and reindex every smart collection
- => And we have, on each collection update, to reindex all of its products.
This would mean a huge indexing overhead that we might not be able to handle for our biggest users, so we have to be very careful before implementing this feature.
If you’re able to put the collections information in tags or metafields, this can be retrieved on a product update.
This would also give you the ability to have variants instead of products in collections.
I would recommend the usage of named tags for this.
Indeed, they are not subject to the same indexing slowdown than metafields and repeating the same named tag will automatically transform the value into an array of values.
Some custom code will then be needed to:
- activate the search page on collections pages
- on those pages, filter on a specific collection