Skip to content

Commit

Permalink
feat: Stricter fuzzy matching
Browse files Browse the repository at this point in the history
We noticed that the current search is a bit too permissive and can
return too many false-positive.
Thus, we reduce the fuzzy matching threshold to be more strict.
  • Loading branch information
paultranvan authored and JF-Cozy committed Jun 27, 2024
1 parent 3e79a23 commit 455586a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helpers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import debounce from 'lodash/debounce'

import flag from 'cozy-flags'

// See https://www.fusejs.io/api/options.html#threshold
// 0.0 is exact-matching, 1.0 is *
const DEFAULT_FUZZY_THRESHOLD = 0.1

const fuseOptions = {
findAllMatches: true,
threshold: 0.3,
threshold: DEFAULT_FUZZY_THRESHOLD,
ignoreLocation: true,
ignoreFieldNorm: true,
keys: [
Expand Down

0 comments on commit 455586a

Please sign in to comment.