74 lines
2.0 KiB
Markdown
74 lines
2.0 KiB
Markdown
---
|
||
description: 'Actions Required for v.1.0.0'
|
||
sidebar_label: 'v1.0.0'
|
||
---
|
||
|
||
# Meilisearch: v1.0.0
|
||
|
||
Version 1.0.0 of the official Meilisearch plugin comes with breaking changes to the plugin options that are passed to the Meilisearch service through `medusa-config.js`.
|
||
|
||
## Overview
|
||
|
||
In the new version of the Meilisearch search plugin, two new plugin configuration properties are introduced; `transformer` and `primaryKey`. As a result, the way indexes in Meilisearch are configured has changed.
|
||
|
||
---
|
||
|
||
## How to Update
|
||
|
||
Run the following command in the root directory of your Medusa Backend:
|
||
|
||
```bash npm2yarn
|
||
npm install medusa-plugin-meilisearch@1.0.0
|
||
```
|
||
|
||
---
|
||
|
||
## Actions required
|
||
|
||
As you can see from the new object shape, the property `indexSettings` has been introduced to hold the settings specific to Meilisearch’s index options. This has been done to make space for new settings like `transformer` and `primaryKey`.
|
||
|
||
Previously, your Meilisearch plugin configurations were something like this:
|
||
|
||
```js title=medusa-config.js
|
||
const plugins = [
|
||
// ...
|
||
{
|
||
config: {
|
||
host: "https://search-api-example.com",
|
||
apiKey: "some_key",
|
||
},
|
||
settings: {
|
||
products: {
|
||
searchableAttributes: ["title", "description"],
|
||
attributesToRetrieve: ["title", "description"],
|
||
},
|
||
},
|
||
},
|
||
]
|
||
```
|
||
|
||
In the above example, an index `products` has been configured with the two options `searchableAttributes` and `attributesToRetrieve`. Updating to 1.0.0 requires you to nest these options within the `indexSettings`.
|
||
|
||
The updated plugin options would look like so:
|
||
|
||
```js
|
||
const plugins = [
|
||
// ...
|
||
{
|
||
config: {
|
||
host: "https://search-api-example.com",
|
||
apiKey: "some_key",
|
||
},
|
||
settings: {
|
||
products: {
|
||
indexSettings: {
|
||
searchableAttributes: ["title", "description"],
|
||
attributesToRetrieve: ["title", "description"],
|
||
},
|
||
},
|
||
},
|
||
},
|
||
]
|
||
```
|
||
|
||
You can learn more about the new settings in the [MeiliSearch plugin documentation](../../../plugins/search/meilisearch.md) |