You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fuse is returning search results that have scores but have no matches.
I'm using Fuse to search objects that look like this:
export class Business {
public name: string,
public number: string,
public street: string,
public city: string,
public state: string,
public zipCode: string,
public website: string,
public phone: string,
public description: string,
public logoImgSrc: string,
public distance: number,
public categories: Array<string>,
public discount: string,
public spanishDescription: string,
public spanishDiscount: string
}
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.
The scores with matches range from 0.0008140476608581672 for a business called "Old Standard Bank" to 0.39039305209113007 for a business where the match is "lo" at character index 59 in the description field.
8 of the businesses come back in the search results with no matches, and they all have a score of 0.4598587108156556.
Furthermore, if I adjust the minimum match character length from 2 to 3 for this search term:
I still get 38 search results.
15 of the results have no matches.
5 of the results with no matches have higher scores than at least one other result that does have a match.
No-match scores range from 0.08129004777396812 to 0.4598587108156556.
Highest-ranked business with no matches is 19th out of 38.
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
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: