Skip to content
Discussion options

You must be logged in to vote

Late reply — sorry about that.

This is expected with the default settings. Fuse is a fuzzy search library, so "wales" will partially match other short strings like "Rains" (they share common characters). The default threshold of 0.6 is fairly permissive.

A couple of things you can do:

  1. Lower the threshold — e.g. threshold: 0.3 will require closer matches.
  2. Enable includeScore — you'll see the second result has a much worse (higher) score, so you can filter or visually distinguish them.
  3. Use extended search — if you want exact substring matching, useExtendedSearch: true with the 'wales (include-match) operator will only return items containing that exact substring.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by krisk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants