You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, I'm trying to use fuse.js to fuzzy search within a large string.
const text ='...very large text';
const query = 'some query';
const result = new Fuse([text], {
threshold: 0.1,
includeMatches: true,
includeScore: true,
isCaseSensitive: false,
ignoreLocation: true,
}).search(query);
console.log(
result[0].matches[0].indices.map(([start, end]) => start, end, text.slice(start, end + 1))
);
this does match but I don't know which match is best. most are are useless. it's not the longest one, and it's apparently not even the longest one that is shorter than the query.
I think this might require some changes in the source code, to get scoring per match or get them sorted.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hi, I'm trying to use fuse.js to fuzzy search within a large string.
this does match but I don't know which match is best. most are are useless. it's not the longest one, and it's apparently not even the longest one that is shorter than the query.
I think this might require some changes in the source code, to get scoring per match or get them sorted.
Is there any way to achieve this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions