-
Notifications
You must be signed in to change notification settings - Fork 64
[Feature/Discussion] Configure the index for a collection to support combined indexes #215
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
Conversation
|
Hello @MattieBelt! Thanks for this PR. Once you finished the PR, please make it "Ready for review", don't let it as a draft. Then ping @bidoubiwa, she will review your PR! (at the moment she's on vacation) |
|
Hey @curquiza, This PR was intentionally created as a draft, because it more so a way to discuss the idea of configurable indexes with you guys.
She said she would later look into this PR, after the But no rush on it, it can wait. |
|
@MattieBelt Thanks a lot for this 🙏🏼 Will wait for the release. We use strapi and we have done everything in the website except for search. I will be the first user when we have this merged 🙂 |
|
Hey @MattieBelt I will be working on this review and on the repo in itself the following weeks :) Sorry for the delay |
|
Closed in favor of #288 |
This draft PR is a way to discuss/review the changes and choices I made in the forked package
@mattiebelt/strapi-plugin-meilisearchUse case
An user has multiple Strapi collection types in his portfolio, he has Projects, Blogs and Tools. He want to create one search bar that can search multiple indexes. As of now, this isn't available with Meilisearch.
Solution
Use one index for multiple collection types, so have a combined index (e.g.
portfolio)Problem
Currently you can only enable or disable the indexing of objects per collection type with
strapi-plugin-meilisearch.You are not able to specify an custom index in which the objects should be created.
Changes I made
{ name: 'project', index: 'portfolio' })Why choose for file config only.
After first trying to make an index editable through the Admin panel, I ran into problems. The
getCollectionsmethod does return based on `strapi.contentTypes, which make it not possible to save any options per collection type. So the way the collection types are handled must first be changed to allow an index to be configured through the Admin panel. Because this meant there needed to be made to much changes, I choose for file configurations with some hot glue, to just make it work. 😉My goal was only to make this possible for the use case from above and I also knew the code wasn't ready to be merged into this repo, that's why I choose to publish an scoped package.
Example
Related Issues