krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.76k stars 753 forks source link

minMatchCharLength not working as expected #764

Open DesmondHsu opened 2 months ago

DesmondHsu commented 2 months ago

Is there an existing issue for this?

Description of the bug

When looking for a x-character item, result is not actually limit result at minMatchCharLength.

Version replicable: 7.0.0

The Fuse.js version where this bug is happening.

Other (please specify in description)

Is this a regression?

Which version did this behavior use to work in?

None

Steps To Reproduce

using Live demo

list.json

[
  "Taylor Swift", "or something rather"
]

Input:

taylor swft

With config being:

const fuseOptions = {
    minMatchCharLength: 12,
};

Expected behavior

It is expected "Taylor Swift" would be the result for it is 12 characters long. For such input "taylor swft" which is 11 characters long, the acceptable value for minMatchCharLength appears to be 9. It should rather work for 9, 10, 11, and 12.

Screenshots

Screenshot 2024-04-08 at 10 36 10 am

Additional context

No response