Closed giladbarnea closed 1 year ago
Yeah, this is intended behavior for the useSellers
option. The seller's version of the levenshtein distance finds the best matching substring, so if the whole search term is found somewhere in the string it reports a perfect match. It's a bit confusing for sure that useSellers
is true
by default, but its a leftover from the original versions of the library. If I were to rewrite the library from scratch, it would definitely be opt-in instead of opt-out. Something for a v2.
You can set useSellers
to false
to get the behavior you're expecting.
Alright, thanks!
Hi!
In other words, the score is 100% dictated by the prefix/suffix of the candidate, and whatever's in the middle has 0 significance.
This means that both of the following candidates have the same score -- 1:
If this is by design, then my bad, but the intuition goes like:
WDYT?
Thanks!