* feat(medusa-plugin-meilisearch): Upgrade meilisearch deps + migrate plugin to TS * fix version * Remove transaction base service from search service * Create .changeset/strange-mails-pump.md * Backward compatibility * Address PR feedback * Fix folder structure * Update readme * Move types * fix deps * Change version in changeset --------- Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
1.6 KiB
1.6 KiB
medusa-plugin-meilisearch, @medusajs/medusa
| medusa-plugin-meilisearch | @medusajs/medusa |
|---|---|
| major | patch |
feat(medusa-plugin-meilisearch): Update + improve Meilisearch plugin
What
- Bumps
meilisearchdep to latest major - Migrates plugin to TypeScript
- Changes the way indexes are configured in
medusa-config.js:
Before
{
resolve: `medusa-plugin-meilisearch`,
options: {
config: { host: "...", apiKey: "..." },
settings: {
products: {
searchableAttributes: ["title"],
displayedAttributes: ["title"],
},
},
},
},
After
{
resolve: `medusa-plugin-meilisearch`,
options: {
config: { host: "...", apiKey: "..." },
settings: {
products: {
**indexSettings**: {
searchableAttributes: ["title"],
displayedAttributes: ["title"],
},
},
},
},
},
This is done to allow for additional configuration of indexes, that are not necessarily passed on query-time.
We introduce two new settings:
settings: {
products: {
indexSettings: {
searchableAttributes: ["title"],
displayedAttributes: ["title"],,
},
primaryKey: "id"
transformer: (document) => ({ id: "yo" })
},
},
Meilisearch changed their primary key inference in the major release. Now we must be explicit when multiple properties end with id. Read more in their docs.
The transformer allows developers to specify how their documents are stored in Meilisearch. It is configurable for each index.