Open dbismut opened 3 months ago
Version 7.0 (but reproductible in 6.6.2)
It seems like when using a threshold of 0 combined with ignoreLocation to return a perfect match, as long as there is one perfect match in the searched text, all other groups of matches are returned no matter how fuzzy they are.
threshold
0
ignoreLocation
JSFiddle: https://jsfiddle.net/dp4efm2s/12/
7.0.0
Not sure
const list = [ { title: 'rouge desert groue'}, ] const fuseOptions = { //isCaseSensitive: false, includeScore: true, shouldSort: false, includeMatches: true, findAllMatches: false, minMatchCharLength: 2, threshold: 0, ignoreLocation: true, keys: ["title"] }; const fuse = new Fuse(list, fuseOptions); // Change the pattern const searchPattern = "rouge" console.log(fuse.search(searchPattern))
Here is the returned object:
[{ item: { title: "rouge desert groue" }, matches: [{ indices: [[0, 4], [9, 10], [13, 17]], key: "title", value: "rouge desert groue" }], refIndex: 0, score: 0.01857804455091699 }]
There is only one perfect matching indice — which is the first one — so only one indice should be returned:
[{ item: { title: "rouge desert groue" }, matches: [{ indices: [[0, 4]], // only ONE indice should be returned key: "title", value: "rouge desert groue" }], refIndex: 0, score: 0.01857804455091699 }]
No response
Is there an existing issue for this?
Description of the bug
Version 7.0 (but reproductible in 6.6.2)
It seems like when using a
threshold
of0
combined withignoreLocation
to return a perfect match, as long as there is one perfect match in the searched text, all other groups of matches are returned no matter how fuzzy they are.JSFiddle: https://jsfiddle.net/dp4efm2s/12/
The Fuse.js version where this bug is happening.
7.0.0
Which version did this behavior use to work in?
Not sure
Steps To Reproduce
Here is the returned object:
Expected behavior
There is only one perfect matching indice — which is the first one — so only one indice should be returned:
Screenshots
No response
Additional context
No response