Migrating Algolia Relevance Data Into Shopify

We’re in the process of migrating a very large catalog into Shopify.

The platform we’re migrating from has its own pre-existing Algolia instance with indexes and relevance data built off of the catalog data in its original format.

The Shopify store uses Algolia’s Shopify integration, with a separate and new Algolia account, with indexes built off of the same product data as it exists within Shopify (Shopify’s product and collection schema).

We’re wondering what our options are for getting the relevance data in the pre-existing Algolia instance (built off of the original platform and product data), and importing it into the Shopify Algolia account (and making it work correctly).

Is this a simple thing to do? Are there significant issues/challenges introduced in getting the relevance data to work across indexes built off of data in different formats? Can we do this at all?

If the new Algolia instance can’t benefit from the relevance data that exists in the original Algolia index, what are our best options for building up relevance data quickly within the new Algolia instance in Shopify?

Could you maybe provide us with more information about which type of relevance data you’re talking about?

  • synonyms?
  • custom numeric values for ranking?
  • something else?

Hi Jerska,

I was able to get the information you requested. Here are the details and some more specific questions:

  1. The previous integration updates indexes by ObjectId, where ObjectId is the product SKU. It looks like Algolia’s Shopify integration is using the product variant ID. Would it be possible for us to have Algolia use the SKU as the ObjectId? I know this could cause some problems since SKUs aren’t unique in Shopify, but they are unique in their catalog. If we aren’t able to do this, what do you think the best path forward would be for allowing them to update the indexes based on product SKU?

  2. They use custom numeric values based on analytics data for ranking, and that would require a new field for the products index. Is it straightforward to allow them to make these updates to the indexes built out of Shopify?

  3. They do product title splitting based on keyword. So for example “Case for iPhone” becomes “primary_title: Case” and “secondary_title: for iPhone”, so the cases won’t outrank the iPhones on searches for “iPhone”. This is another value we’d like them to be able to add to the index from outside of Shopify, but we’re unsure of how to let them do that, and how to configure Algolia’s search within Shopify to use those values appropriately for ranking.

Any insight you can provide on a path forward on these 2 key items (custom numeric value + search title splitting) would be greatly appreciated, whether it’s letting them update the index or some form of feature replication or otherwise.

Thanks again for all your help so far.

I’m sorry for the delay with my answer, I completely missed this one!

It seems to me like all of those could be solved using custom fields, in the form of either Metafields or Named tags. I would recommend the latter option for performance reasons described in the Metafields documentation page.
Those allow you to add data to a product or a variant directly in Shopify.

By using either of those, you could definitely have a script which would browse all of the products of the store, fetch the specific analytics data for a product, and add one or multiple fields which would then be added to your Algolia index.
I’ve described such a script here: Add Product Ratings Attribute to Shopify Products Index .

You could also, within this script, split the title into multiple parts and save those in extra fields
However, if you wanted this behavior to be realtime (every time a product is created or updated), you could

  • have a webserver listening to product/create and product/update webhooks and which would create those fields as soon as they’re triggered
  • or not use the Shopify UI to create/update a product but rather your own which would do this processing then save the product using Shopify’s API