krisk / Fuse

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

Threshold is not ignored when Tokenize is set to true. (Doc says it should) #298

Closed ziadrida closed 4 years ago

ziadrida commented 5 years ago

Use standard example, search for "Lost" and you will get one record back if you use the following settings: var options = { shouldSort: true, tokenize: true, matchAllTokens: true, includeScore: true, threshold: 1, location: 0, distance: 100, maxPatternLength: 32, minMatchCharLength: 1, keys: [ "title", "author.firstName" ] }; var fuse = new Fuse(list, options); // "list" is the item array var result = fuse.search("Lost");

Next change threshold to 1 then to zero and the result will change! It should not.

insulatir commented 4 years ago

I found that fusejs.io says "the threshold, distance, and location are inconsequential for individual tokens, and are thus ignored." but src/index.js says "the threshold, distance, and location are inconsequential for individual tokens."

github-actions[bot] commented 4 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