krisk / Fuse

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

Only match pattern of order instead of letters #629

Closed FlorisdeG closed 2 years ago

FlorisdeG commented 2 years ago

We are working with Fuse in our project, but we notice that we get very weird search results because of how Fuse handles search queries. If you for example look for "Recruiter", you match on the word "Developer" even though the words are nothing alike, but it matches on the patterns "r", "e", "r" again and "er" inside the word "Recruiter", which doesn't make sense.

I know it's possible to set it up a minMatchCharLength. Is it also possible to setup that the letters have to appear in the order of the query, so "recruiter" would match with, for example, "copywriter" (match of "iter"), but not with "developer" as the letters don't appear in the same order?

github-actions[bot] commented 2 years ago

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

FlorisdeG commented 2 years ago

bump to prevent close

narwold commented 1 year ago

I'm running into this right now. I have minMatchCharLength set to 2, and it's telling me that the "ma" portion of my search term ("main") is matching on "am" in the text I'm searching. The order should matter.