I've been mixing and matching every possible combination of options, and it NEVER brings the one I expect to the top. The docs example says:
With the above options, for something to be considered a match, it would have to be within (threshold) 0.6 x (distance) 100 = 60 characters away from the expected location 0
So therefore, let's say I want to focus on the first 15 characters, then with a threshold of 0.4 I would use 0.4*15 to get a distance of 37.5
So I plug that in and ... still nothing. But I don't want to focus just on those 15 anyway. I don't get how, even with a distance of just 10 and a start of 0, it considers "Driffield Talking Newspaper" to be a closer match than "Sheffield Talking News" for the query "Sheffield Talking Newspaper", when surely it shouldn't even be looking past the highlighted part with a low distance?
Currently I've got these options based on the 0.4*15(chars)=37.5 distance, but distance of 15 is the same, too.
UPDATE
Another few more hours of fiddling, and here's what I've arrived at:
Make a very "tight" first search
Then if there's more than one result, feed the results back into a second search
This seems to finally persuade Fuse that Sheffield is more Sheffield than Driffield!
Original question
Fuse 6.4.6 Node 14.17.0
I have a list, and sometimes when people want an item, they get the name slightly wrong. If they get it right, so does fuse:
query: "Sheffield talking news"
{ score: 9.287439764962262e-10, name: 'Sheffield Talking News' }, { score: 0.3167532482101869, name: 'Driffield Talking Newspaper' }, { score: 0.3167532482101869, name: 'Enfield Talking Newspaper' },
But.... query: "Sheffield talking newspaper"
I've been mixing and matching every possible combination of options, and it NEVER brings the one I expect to the top. The docs example says:
So therefore, let's say I want to focus on the first 15 characters, then with a threshold of 0.4 I would use 0.4*15 to get a distance of 37.5
So I plug that in and ... still nothing. But I don't want to focus just on those 15 anyway. I don't get how, even with a distance of just 10 and a start of 0, it considers "Driffield Talking Newspaper" to be a closer match than "Sheffield Talking News" for the query "Sheffield Talking Newspaper", when surely it shouldn't even be looking past the highlighted part with a low distance?
Currently I've got these options based on the 0.4*15(chars)=37.5 distance, but distance of 15 is the same, too.