Closed robert-king closed 8 years ago
Probably related to #38
Have you tried playing with the distance or threshold options? They'll affect how far away from start bitap will loop for a match before bail out.
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold: 0.6,
"zyxwvutsrqpomnlkjihgfedcbaabcdefghijklmnopqrstuvwxyz".length == 52
searching for "pqrstuv" finds nothing.. searching for "opqrstu" gets a match.
"zyxwvutsrqpomnlkjihgfedcbaabcdefghijklmno".length == 41
95% of my strings are less than length 41 anyway & 99.9% of searches are substrings that occur in the first 41 characters anyway. Another fix is to split the string in half across two keys.
Anyway - thought it was worth posting this issue just FYI since lots of people will use fuse.js