meilisearch / strapi-plugin-meilisearch

A strapi plugin to add your collections to Meilisearch

Home Page:https://meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unpublish, delete and delete many does not unindex content on meilisearch anymore

LiquidITGuy opened this issue · comments

Description
Since the 0.7.1 plugins version (to fix afterDeleteMany a working hook), the unpublish, delete and deleteMany hooked methods do not work anymore to unpublish entry in meilisearch.

Expected behavior
When we click on unpublish or delete; the deleted or unpublished content should be unindexed from meilisearch.

Current behavior
no error log nor de-indexing content

Environment (please complete the following information):

  • OS: tried on MacOS M1, MacOs x64, Linux X64, Linux
  • Meilisearch tried on version: 0.28.0 (docker and cloud), 0.28.1
  • strapi-plugin-meilisearch 0.7.1
  • Strapi version: 4.3.2

I have a hard time reproducing this error as it works in my local environment.
Could you try the playground that is on this repo if you have time? Or can we maybe talk on the community slack to have more efficient back and forth ?

I tried with the latest Strapi version as well (4.3.2)

@bidoubiwa I have the same behaviour by cloning the project.
I just joined the slack

If someone have the same purpose ( can be in 0.7.0 and 0.7.1) : (insert data works but nor delete or unpublish entry )

On our side, we were using the transformEntry to change the id to corresponding to our slug in meilisearch.
By doing that the id of the meilisearch content does not match with the deleted one.
to fix that, we just set the id to the corresponding id.

Before (with bug)

transformEntry({entry}) {
          return {
            id: entry.slug,}

After (with bug fixed)

transformEntry({entry}) {
          return {
            id: entry.id,
            slug: entry.slug,}

So if you have the same bug just remove the transformation of the id on your configuration file to avoid it.

Thank you very much @bidoubiwa to help us to find where was the problem.