|
As I am just getting going with Fuse, I am likely doing something wrong - so would appreciate some help. With the code below, when I search for a specific value, I am getting both items return, even though the value is found in only one of the items... Why is this happening ? Thanks This produces output of.... |
Answered by
krisk
Apr 3, 2026
Replies: 1 comment
|
Late reply — sorry about that. This is expected with the default settings. Fuse is a fuzzy search library, so "wales" will partially match other short strings like "Rains" (they share common characters). The default A couple of things you can do:
|
0 replies
Answer selected by
krisk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Late reply — sorry about that.
This is expected with the default settings. Fuse is a fuzzy search library, so "wales" will partially match other short strings like "Rains" (they share common characters). The default
thresholdof0.6is fairly permissive.A couple of things you can do:
threshold: 0.3will require closer matches.includeScore— you'll see the second result has a much worse (higher) score, so you can filter or visually distinguish them.useExtendedSearch: truewith the'wales(include-match) operator will only return items containing that exact substring.