medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.23k stars 2.66k forks source link

Meilisearch facets lost on medusa backend restart #2959

Closed JesusDR01 closed 12 months ago

JesusDR01 commented 1 year ago

Bug report

We are using medusa extender to add the columns: categoryLevelOne, categoryLevelTwo and categoryLevelThree in the product database.

image

We are using medusa plugin meilisearch

 {
    resolve: `medusa-plugin-meilisearch`,
    options: {
      // config object passed when creating an instance of the MeiliSearch client
      config: {
        host: process.env.MEILISEARCH_HOST,
        apiKey: process.env.MEILISEARCH_API_KEY,
      },
      settings: {
        // index name
        products: {
          // MeiliSearch's setting options to be set on a particular index
          searchableAttributes: ["title", "description", "variant_sku"],
          displayedAttributes: ["title", "description", "variant_sku", "thumbnail", "handle","id", "status"],
          filterableAttributes: ["categoryLevelOne","categoryLevelTwo","categoryLevelThree","brand","inOffer","newIn","color"]
        },
      },
    },
  },

Describe the bug

When we start the medusa backend, meilisearch and database sync up successfully. Redis is working, meilisearch is working, everything seems good.

When we update a product in the admin panel and check meilisearch facets, we can see the facets is appearing correctly:

image

When we restart the medusa server and check it again, the facets are gone:

image

System information

Medusa version (including plugins):1.7.2 "@medusajs/medusa-cli": "^1.3.5", "medusa-plugin-meilisearch": "^1.0.0", "medusa-extender": "^1.8.1", "medusa-plugin-algolia": "^0.2.5", //unused "medusa-plugin-strapi": "^1.0.7-dev", //unused

Node.js version: v19.0.0 Database: postgres Operating system: Darwin 22.1.0

Steps to reproduce the behavior

  1. Update medusajs to 1.7.2
  2. Add .env typeorm following this guide: https://docs.medusajs.com/advanced/backend/upgrade-guides/1-7-1
  3. Run in your database: DROP SCHEMA public CASCADE; CREATE SCHEMA public;
  4. execute medusa migrations run
  5. add a product to admin panel with a custom column created by medusa-extender.
  6. Check your meilisearch http://127.0.0.1:7700/indexes/products/search facets.
  7. restart medusa backend.
  8. Check your meilisearch facets again.

Expected behavior

Facets should be displayed. It worked using 1.5.0 medusajs version.

JuanmaDiazRivas commented 1 year ago

Same here, please help

olivermrbl commented 1 year ago

Thanks for filing the issue. I will investigate the issue when time allows, but since you are using the extender, I can't give it top priority, as our general community support does not cover that project.

olivermrbl commented 12 months ago

Hi there. We highly appreciate you filing an issue and showing an interest in improving Medusa.

I apologize for the delayed response.

Moving forward, we aim to do better. But we would like to start fresh. Therefore, we are considering all older issues as stale and closing them, even though they might still be relevant.

Please don’t hesitate to re-open the issue (or create a new one) if you still need a resolution or an answer.

Thanks ❤️