strapi-plugin-meilisearch
strapi-plugin-meilisearch copied to clipboard
Possibility to use a content-type in multiple indexes
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.
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!
Any news on this?
Hello @ddegooijer and anyone reading this issue
Feel free to open a PR, we are available for review!
Hello @bidoubiwa how far are we to this update ?
hello @L-Weisz No one implemented it yet.
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
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 ❤️