-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
Should-be perfect match has non-zero score #481
Comments
Seeing this too, perfect matches are scoring above 1.4 Only happens when using nested values though Following works as expected: const items = ['test1', 'test2', 'test3'];
const fuse = new Fuse(items, {
includeScore: true,
});
console.log(fuse.search('test2')); // score => 0 |
The score value is fuse.search('test2').forEach((it) => it.score = Number(it.score.toFixed(2))); |
I've used that workaround too, although I would recommend using |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Bump |
Describe the bug
When searching for a keyword in a list of objects, the search works and finds matches. However, the should-be perfect matches return a non-zero score like
2.220446049250313e-16
. This should be 0 as it is a perfect match, but due to not being exactly 0, it continues the search.The Minimal Production below gives this as its result:
Version
6.4.1
Is this a regression?
Yes, the previous version in which this bug was not present was: 3.6.1
(Im using it in another project, there it works fine)
🔬Minimal Reproduction
The text was updated successfully, but these errors were encountered: