Closed jaschaio closed 4 years ago
@jaschaio
I would expect only to find one results which exactly matches the given term. If I just search for
ste
than I would understand why it returns the other results.
and
I would expect only to find one results which exactly matches the given term
What you're looking for is a simple substring or regex based searching. There's no need for a library, in this case.
Note that Fuse is an Approximate string matching library. That is, it measures closeness, not exactness.
When measuring closeness, you will inevitably get results which appear to have little do with the search query. However, that is a byproduct of the matching configuration, which you can tweak by altering the location
, threshold
, and distance
options.
If you wanted to further filter the results, you can simply omit from the returned list any results whose score is not "good" enough, which is wholly subjective.
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
I have just been playing with the Demo on http://fusejs.io/ and it seems to me that it doesn't really work well.
These are my options:
These are my results:
I don't see why all those results should return when I am searching for
steve
. Yes, the second result with a score of0.43
matchesMon*ste*r
part of it, but not the whole word. If this were the results list for a real search I wouldn't be happy.I would expect only to find one results which exactly matches the given term. If I just search vor
ste
than I would understand why it returns the other results.How would I got about this in a real application? Playing with the
treshold
doesn't seem reliable enough. Maybe I have to set theminMatchCharLength
to the same lenght as my search string, but this still gives me very similar results.Would be really grateful if someone explains to me what I am overlooking.
Thanks!