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

Possibility to use a content-type in multiple indexes

Open Pablo-Aldana opened this issue 2 years ago • 3 comments

Description Not sure if it is a new feature request or a bug but: Possibility to use a content-type in multiple indexes Currently it is possible to create custom indexes and for example create a index called products with content-type Shoes and T-shirts

But once you create one you cannot re-use the content type for another index example "offers".

For my understanding it is possible to do it with meilisearch as you can add any information to any index but it is not possible with this plugin.

Basic example An option could be to change the config of the plugin and instead write the content type name as root of the json, use instead the index name

currently the config looks like

module.exports = () => ({
  //...
  meilisearch: {
    config: {
      shirts: {
        indexName: 'products',
      },
      shoes: {
        indexName: 'products',
      },
    shirts: {
indexName: 'offers'. //THIS is not possible right now as overwrite previous index.
}
    },
  },
})

What I propose is

module.exports = () => ({
  //...
  meilisearch: {
    config: {
      products: {
        contentType: ['shoes','t-shirt']
      },
      offers: {
         contentType: ['jackets','t-shirt']
      },
     
    },
  },
})

Or as it is right now but not overwriting previous information and being able to manage it over the admin panel. But I do believe it would be easier the first option.

Pablo-Aldana avatar Feb 07 '23 15:02 Pablo-Aldana

Hey @Pablo-Aldana It is indeed a new feature request! No reason why we shouldn't implement this, it's a good idea!

I will add it to the stack of new features to add in this plugin. Meanwhile if someone wants to contribute and implement it, it can be faster!

bidoubiwa avatar Feb 15 '23 10:02 bidoubiwa

Any news on this?

ghost avatar Jul 26 '23 12:07 ghost

Hello @ddegooijer and anyone reading this issue

Feel free to open a PR, we are available for review!

curquiza avatar Oct 11 '23 09:10 curquiza

Hello @bidoubiwa how far are we to this update ?

L-Weisz avatar Mar 25 '24 11:03 L-Weisz

hello @L-Weisz No one implemented it yet.

curquiza avatar Mar 25 '24 17:03 curquiza

Hello I created a pull request to handle multiple indexes, I also have the a fork with the changes if anyone want to use it immediately

L-Weisz avatar Apr 04 '24 14:04 L-Weisz

Hello @L-Weisz thank you very much for this PR

@brunoocasali will review it once he will come back from Holidays (starting today evening and he comes back in 3 weeks)

In the meantime, everyone is more than welcome to review it and give their feedback ❤️

curquiza avatar Apr 04 '24 15:04 curquiza