Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LiquidITGuy opened this issue Aug 8, 2022 · 3 comments · Fixed by #489
Closed

Comments

@LiquidITGuy
Copy link
Contributor

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
@bidoubiwa
Copy link
Contributor

bidoubiwa commented Aug 9, 2022

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)

@LiquidITGuy
Copy link
Contributor Author

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

@LiquidITGuy
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants