-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Feature request] Support scoring arrays of strings, in addition to single strings #12
Comments
Thanks for the feedback! I was actually just thinking about matching against an array of strings, from a discussion in #11. Would you expect the score for an array of strings to be highest score for any of the strings? The average? Another complexity is returning which string matched. Not sure if that should be an index into the array or the actual string containing the match. It's also tricky if multiple strings have the same score.
Matching the |
Absolutely! Thanks for working on this library :)
I think what would be ideal would be if the score matched the highest of the strings. We only use the score to sort the options, and in the case that there's a match to one of the elements in the array, we'd want to show it near the top.
What fuse does is to return another field in the search result that corresponds to the full matched value. I guess the analogous field here would be a
Ah yes this might be tricky. In our use case, if multiple strings have the same score, having only one of them would be more than sufficient. What's currently done today in the |
The first key in the |
Hi there! Thanks for this library. I've been trying out different search libraries for a project, and have been really impressed thus far with quickscore!
One feature that would be super helpful is support for keys that reference non-string values.
Example 1: Array
It'd be really useful to have support for
const qs = new QuickScore(bookmarks, ["title", "labels"]);
.One quick solution would be to join the array to a string, but that has some difficulties with search matches. I.e., "work added" would match the first result with a high score, when it should probably have a lower score if each label was considered separately.
Example 2: Array of objects
This would be really cool, but also handleable by pre-processing if Example 1 is supported.
I think fuse supports both of these use cases, but haven't seen other libraries that do. Would be awesome if quickscore supported it!
The text was updated successfully, but these errors were encountered: