Skip to main content

Algolia: v1.0.0

Version 1.0.0 of the official Algolia plugin comes with breaking changes to the plugin options that are passed to the Algolia service through medusa-config.jsCopy to Clipboard.

Overview

In the new version of the Algolia search plugin, two new plugin configuration properties are introduced; transformerCopy to Clipboard and primaryKeyCopy to Clipboard. As a result, the way indexes in Algolia are configured has changed. Additionally, the existing settings have been changed to follow a camel casing - though with backward compatibility.


How to Update

Run the following command in the root directory of your Medusa Backend:

yarn add medusa-plugin-algolia@1.0.0
Report Incorrect CodeCopy to Clipboard

Actions required

As you can see from the new object shape, the property indexSettingsCopy to Clipboard has been introduced to hold the settings specific to Algolia’s index options. This has been done to make space for the transformerCopy to Clipboard.

Previously, you might have configured the Algolia plugin as seen below:

medusa-config.js
const plugins = [
// ...
{
application_id: "someId",
admin_api_key: "someApiKey",
settings: {
// example
products: {
searchableAttributes: ["title", "description"],
attributesToRetrieve: ["title", "description"],
},
},
},
]
Report Incorrect CodeCopy to Clipboard

In the above example, an index productsCopy to Clipboard has been configured with two options searchableAttributesCopy to Clipboard and attributesToRetrieveCopy to Clipboard. Updating to v1.0.0 requires you to nest these within the indexSettingsCopy to Clipboard. Additionally, the admin API key and application ID options should now be in camel case, as the snake-cased version will be deprecated.

The updated plugin options would look like so:

medusa-config.js
const plugins = [
// ...
{
applicationId: "someId",
adminApiKey: "someApiKey",
settings: {
products: {
indexSettings: {
searchableAttributes: ["title", "description"],
attributesToRetrieve: ["title", "description"],
},
},
},
},
]
Report Incorrect CodeCopy to Clipboard

You can learn more about the new plugin options in the Algolia plugin documentation.

Was this page helpful?