strapi-plugin-meilisearch icon indicating copy to clipboard operation
strapi-plugin-meilisearch copied to clipboard

Allow each language to go into its own index

Open davidwebster48 opened this issue 1 year ago • 8 comments

My content is available in many languages, using Strapi's i18n plugin.

According to the Meilisearch docs, it is advised to "split your dataset—one language per index".

However, I don't think this is possible using the Meilisearch Strapi plugin. According to this comment it wasn't possible last year, and I can't see anything in the docs about how to do this.

Here is my suggestion for how this could be configured...

// config/plugins.js

module.exports = () => ({
  //...
  meilisearch: {
    config: {
      restaurant: {
        indexName: "my_restaurants",
        oneIndexPerLocale: true,
      }
    }
  }
})

This would automatically create one index per locale, and append the locale code to the index name, so you'd get indexes like my_restaurants-en, my_restaurants-es, my_restaurants-pl, etc.

davidwebster48 avatar Jun 27 '24 23:06 davidwebster48

We have been waiting for this feature for a long time. We hope the team will implement it as soon as possible. Thanks @davidwebster48 for mentioning this enhancement.

BenCherif avatar Jul 02 '24 08:07 BenCherif

@curquiza I would like to help on implementing this. I have taken a look at the code and identified several places where I could "hook" this in, but I would like to make it work according to the maintainers "style", so if you could hint me on where the best place to add this feature would be I could start a PR ?

tomh4 avatar Jan 02 '25 12:01 tomh4

Hey @zoran995, since you contributed a lot recently, maybe you would have insights for @tomh4 here? 🤗

Strift avatar Jan 08 '25 08:01 Strift

An update on this would be great guys

@tomh4 Would you mind sharing what solution you came up with ?

Kvintus avatar Feb 04 '25 11:02 Kvintus

None... I awaited a reply but as none came I accepted it as is.

tomh4 avatar Feb 04 '25 14:02 tomh4

It would be nice if this can be added.

phyziyx avatar Feb 04 '25 17:02 phyziyx

Yes, especially because localization at its current state is actually broken See https://github.com/meilisearch/strapi-plugin-meilisearch/issues/988

tomh4 avatar Feb 04 '25 17:02 tomh4

I currently don't have the bandwidth to tackle this myself. However, everyone is welcome to open a PR for this.

We will accept and merge the first PR fixing the issue (while adhering to our contributing guidelines.) Thank you!

Strift avatar Feb 08 '25 10:02 Strift