Skip to content

Commit

Permalink
Update meilisearch.md (#7862)
Browse files Browse the repository at this point in the history
Problem:

The existing documentation for the Meilisearch plugin contains example that, if copy-pasted exactly, will not work.

Solution:

I have updated the Meilisearch plugin configuration example to reflect the correct settings. 

Benefits:

With this updated code snippet, users can simply copy and paste it into their local medusa-config.js file. It will work seamlessly with the standard configuration and is compatible with the latest version of Meilisearch.

Testing:

The updated configuration has been tested and confirmed to work in a live deployment environment on Digital Ocean(Server) and Vercel(Storefront)


<img width="999" alt="image" src="https://github.com/medusajs/medusa/assets/130260096/a277e14e-246c-4307-90d2-10880d2bc913">

<img width="1434" alt="image" src="https://github.com/medusajs/medusa/assets/130260096/4063b53f-3589-47a8-a300-a0d4a19201a2">
  • Loading branch information
pavlotsyhanok authored Sep 23, 2024
1 parent d09630c commit 6c0ce5a
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions www/apps/docs/content/plugins/search/meilisearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,32 @@ const plugins = [
{
resolve: `medusa-plugin-meilisearch`,
options: {
// other options...
config: {
host: process.env.MEILISEARCH_HOST,
apiKey: process.env.MEILISEARCH_API_KEY,
},
settings: {
products: {
indexSettings: {
searchableAttributes: [
"title",
searchableAttributes: ["title", "description", "variant_sku"],
displayedAttributes: [
"title",
"description",
"variant_sku",
],
displayedAttributes: [
"id",
"title",
"description",
"variant_sku",
"thumbnail",
"thumbnail",
"handle",
],
},
primaryKey: "id",
transformer: (product) => ({
id: product.id,
title: product.title,
description: product.description,
variant_sku: product.variant_sku,
thumbnail: product.thumbnail,
handle: product.handle,
// include other attributes as needed
}),
},
},
},
Expand Down

0 comments on commit 6c0ce5a

Please sign in to comment.