I am trying to implement an exact name match on a database.
Is there a way to get only "Smith", and not "Smithee", "Smithers", "Smithe" etc? Setting the Distance and Threshold to 0 do not do it. I can of course go through the results once they have appeared and take out the unwanted values, but it would be more efficient to do it in one take.
(Hopefully you're on the latest version of Fuse.js)
If your data looks like something like this:
const list = [{ name: 'Smith' } /*, etc...*/]
You could use extended search:
const fuse = new Fuse(list, {
keys: ['name'],
useExtendedSearch: true
})
// Search for items that exactly match "smith"
fuse.search('=smith')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With