Skip to content

Commit

Permalink
Increase search distance (#167)
Browse files Browse the repository at this point in the history
This increases the search distance from 100 to 300, which helps to find
better or more results in certain cases.
  • Loading branch information
Mrtenz authored Oct 12, 2023
1 parent 2cc8888 commit 922ea8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/features/filter/components/FilterSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const FilterSearch: FunctionComponent = () => {
const searchQuery = useSelector(getSearchQuery);
const searchResults = useGatsbyPluginFusejs<Snap>(searchQuery, fusejs, {
threshold: 0.3,
distance: 300,
});

const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
Expand Down
1 change: 1 addition & 0 deletions src/types/vendor/react-use-fusejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ declare module 'react-use-fusejs' {
},
fuseOptions?: {
threshold: number;
distance: number;
},
): { item: Type }[];
}

0 comments on commit 922ea8e

Please sign in to comment.