I have installed meilisearch on windows and I am running it via docker. The meilisearch server is ran on http://localhost:7700. I have confirmed the server is live since when I go to the domain above it shows me the dashboard and if I use the master_key that I am using in my medusa backend I get that "products" are indexed but documents inside are not, picture included below.
I also get an error when starting the medusa development server with yarn dev:
class_1 [MeiliSearchApiError]: Unknown field `indexSettings`: expected one of `displayedAttributes`, `searchableAttributes`, `filterableAttributes`, `sortableAttributes`, `rankingRules`, `stopWords`, `nonSeparatorTokens`, `separatorTokens`, `dictionary`, `synonyms`, `distinctAttribute`, `proximityPrecision`, `typoTolerance`, `faceting`, `pagination`, `embedders`
code: 'bad_request',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#bad_request',
httpStatus: 400
This is weird since I am using the configuration in the documentation:
// medusa-config.js
{
resolve: `medusa-plugin-meilisearch`,
options: {
config: {
host: MEILISEARCH_HOST,
apiKey: MEILISEARCH_API_KEY,
},
settings: {
products: {
indexSettings: {
searchableAttributes: ["title", "description", "variant_sku"],
displayedAttributes: [
"title",
"description",
"variant_sku",
"thumbnail",
"handle",
],
},
primaryKey: "id",
transformer: (product) => ({
id: product.id,
}),
},
},
},
},
I am also providing the mentioned constants in .env and in medusa-config.js file:
// medusa-config.js
const MEILISEARCH_HOST =
process.env.MEILISEARCH_HOST || "http://localhost:7700";
const MEILISEARCH_API_KEY = process.env.MEILISEARCH_API_KEY || "";