krisk / Fuse

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

minMatchCharLength not working as expected #764

Closed DesmondHsu closed 2 months ago

DesmondHsu commented 7 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

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days