Closed washtenawIdtreble closed 4 years ago
Searching for "remy" in the demo returns unrelated records as well. https://fusejs.io/demo.html
Searching for "remy" in the demo returns unrelated records as well. https://fusejs.io/demo.html
Very helpful, thanks for finding that!
Yes, this is a bug, thanks for filing this. minMatchCharLength
is ignored when determining which records to exclude. I'll address it for the next release.
Now in latest fuse.js@6.2.0
Describe the bug
Fuse is returning search results that have scores but have no matches.
I'm using Fuse to search objects that look like this:
My fuse options look like this:
I'm using a very high distance because I essentially want to ignore it. Some of the fields I'm searching are hundreds of characters long, and I don't care whether a match is found at the beginning or the end. I discovered that using a huge distance limits its impact on the score.
Note that I'm using half the search term length (rounded up) for the minimum match character length. I'm planning to experiment with changing that. I want users to be able to make typos where there are too many letters, so I didn't want to say that the minimum match character length was exactly the search term length. Maybe this is misguided.
When I run a search for the word "old" on an array of 38 of these businesses, the results include all 38 businesses.
Furthermore, if I adjust the minimum match character length from 2 to 3 for this search term:
How is it possible to get search results that have no matches? Am I using Fuse wrong in some way?
Version
5.2.3
Is this a regression?
I don't know