-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hey there!
I've been using the fuzzy-search plugin and found it to be a fantastic tool for searching through content. However, I believe there's room for improvement by allowing users to define the fields to be returned and by introducing a more efficient way to handle complex queries through content type population.
Feature Request 1: Customizable Field Selection
Currently, the fuzzy-search plugin returns all fields for a given content type. While this can be useful, there are situations where we only need specific fields for our search results. To address this, I suggest introducing a feature that allows users to define the fields to be returned, providing more control and potentially improving performance on content types with a large number of fields.
Here's an example of how the configuration could look:
// ...
{
uid: "api::book.book",
modelName: "book",
fields: ["name", "description"],
fuzzysortOptions: {
// ...
},
},
// ...
Feature Request 2: Content Type Population for Complex Queries
Building complex queries can be a time-consuming and error-prone process. To simplify this, why not allow users to define content type populations directly within the search configuration? This would serve as a base configuration that can be extended when querying search results, making it much more convenient and reducing the need to build complex queries repeatedly.
Here's an example of how this could work:
// ...
{
uid: "api::book.book",
modelName: "book",
fields: ["name", "description"],
populate: {
authors: {
// - maybe also allow fields here too?
populate: {
city: true
}
}
},
fuzzysortOptions: {
// ...
},
},
// ...
These two feature requests would greatly enhance the flexibility and usability of the fuzzy-search plugin, making it even more valuable for developers working with large and complex datasets.
I hope you find these suggestions helpful and consider implementing them in future updates. Thank you for your continued efforts to improve the plugin!
Best regards,
Tobi