-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Key weighting - enhancement #62
Labels
Comments
I like this. |
Thanks for a great suggestion. Let's make it happen 👍 |
Implementation: var fuse = new Fuse(books, {
keys: [{
name: 'title',
weight: 0.3
}, {
name: 'author',
weight: 0.7
}],
}); Where I published a new version: 2.1.0-beta. Let me know what you think. Thanks! |
@krisk in your example, is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love the library so far, great work! One potential enhancement, (which if I find time I would love to do myself). Sometimes you want certain keys to have a stronger weighting. For example if you were searching for "Cheese" through the following library of books, you would maybe want "French Cheeses" to be your top match, however at the moment "101 Sandwiches" would take top billing due to a higher score in the description field.
What I propose is an optional more advanced syntax for keys, where you provide some kind of
modifier
to that key making it less/more important than it's siblings. The final scoring could then be skewed via it's modifier.The text was updated successfully, but these errors were encountered: