Skip to content

Commit

Permalink
feat: tweak the fuzzy search to be less fuzzy (#45)
Browse files Browse the repository at this point in the history
It turns out that for the use-case of searching for names, the defaults
that come with Fuse.JS are a little bit _too_ loose. Therefore, this
tightens them up a bit by decreasing the threshold and distance as
outlined here:

    https://www.fusejs.io/api/options.html#fuzzy-matching-options

This reduces them down significantly, but I think that should be better
for match on exact names when the user clicks on the appropriate button.
  • Loading branch information
scallaway committed Oct 18, 2023
1 parent 9564327 commit 1136249
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qvet-web/src/components/CommitSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ const useFuzzySearch = (list: Array<Commit>, search: string) => {
// We don't want sorting here as it will mess up the order (since it will
// order by closest match first)
shouldSort: false,
threshold: 0.3,
distance: 30,
});
}, [list]);

Expand Down

0 comments on commit 1136249

Please sign in to comment.