#Meilisearch not indexing products (products 0)

8 messages · Page 1 of 1 (latest)

quaint arrow
#

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 || "";
#

good to note is this info i get in the console also upon running yarn dev:

info:    Processing SEARCH_INDEX_EVENT which has 1 subscribers
#

I am using meilisearch version 1.7 and my package.json is below:

{
  "scripts": {
    "dev": "cross-env npm run build:server && medusa develop"
  },
  "dependencies": {
    "@medusajs/admin": "latest",
    "@medusajs/cache-inmemory": "latest",
    "@medusajs/cache-redis": "latest",
    "@medusajs/event-bus-local": "latest",
    "@medusajs/event-bus-redis": "latest",
    "@medusajs/file-local": "latest",
    "@medusajs/medusa": "latest",
    "@tanstack/react-query": "4.22.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "16.3.1",
    "express": "^4.17.2",
    "medusa-fulfillment-manual": "latest",
    "medusa-interfaces": "latest",
    "medusa-payment-manual": "latest",
    "medusa-payment-stripe": "^6.0.9",
    "medusa-plugin-meilisearch": "1.0.0",
    "prism-react-renderer": "^2.0.4",
    "typeorm": "^0.3.16"
  },
  "devDependencies": {
    "@babel/cli": "^7.14.3",
    "@babel/core": "^7.14.3",
    "@babel/preset-typescript": "^7.21.4",
    "@medusajs/medusa-cli": "latest",
    "@types/express": "^4.17.13",
    "@types/jest": "^27.4.0",
    "@types/node": "^17.0.8",
    "babel-preset-medusa-package": "^1.1.19",
    "cross-env": "^7.0.3",
    "eslint": "^6.8.0",
    "jest": "^27.3.1",
    "rimraf": "^3.0.2",
    "ts-jest": "^27.0.7",
    "ts-loader": "^9.2.6",
    "typescript": "^4.5.2"
  },
}
quaint arrow
#

Meilisearch not indexing products (products 0)

little moss
#

have you fix this bugs, i met the same problems white itergrating meilisearch

quaint arrow
#

not yet will tag you if I fix it, please do the same if you do 🙏

little moss
#

"dependencies": {
"@medusajs/admin": "latest",
"@medusajs/cache-inmemory": "latest",
"@medusajs/cache-redis": "latest",
"@medusajs/event-bus-local": "latest",
"@medusajs/event-bus-redis": "latest",
"@medusajs/file-local": "latest",
"@medusajs/medusa": "latest",
"@tanstack/react-query": "4.22.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "16.3.1",
"express": "^4.17.2",
"medusa-file-s3": "latest",
"medusa-fulfillment-manual": "latest",
"medusa-interfaces": "latest",
"medusa-payment-manual": "latest",
"medusa-payment-stripe": "latest",
"medusa-plugin-meilisearch": "latest",
"medusa-plugin-sendgrid": "latest",
"prism-react-renderer": "^2.0.4",
"typeorm": "^0.3.16"
},

#

i fixed the bugs, the reason is version conflict between dependencies, i dont know which one so i change most of them to latest and melisearch work fine