Skip to content

Commit cbfa896

Browse files
authored
increase platformFilter sorter match threshold (#12547)
1 parent 6f5fbf8 commit cbfa896

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/platformFilter/client.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {useMemo, useState} from 'react';
33
import * as Collapsible from '@radix-ui/react-collapsible';
44
import {TriangleRightIcon} from '@radix-ui/react-icons';
55
import classNames from 'classnames';
6-
import {matchSorter} from 'match-sorter';
6+
import {matchSorter, rankings} from 'match-sorter';
77
import Link from 'next/link';
88

99
import {type Platform} from 'sentry-docs/types';
@@ -63,7 +63,10 @@ export function PlatformFilterClient({platforms}: {platforms: Platform[]}) {
6363
}
6464
// any of these fields can be used to match the search value
6565
const keys = ['title', 'aliases', 'name', 'sdk', 'keywords'];
66-
const matches_ = matchSorter(platformsAndGuides, filter, {keys});
66+
const matches_ = matchSorter(platformsAndGuides, filter, {
67+
keys,
68+
threshold: rankings.CONTAINS,
69+
});
6770
return matches_;
6871
}, [filter, platformsAndGuides]);
6972

0 commit comments

Comments
 (0)