From 4f701027ac0a5de6c52fb6285edf79752c84ad0e Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Tue, 20 Jul 2021 15:53:25 +0200 Subject: Remove limitation on minimal matched length (#1978) --- .../base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'plugins/base/frontend/src/main/components/search') diff --git a/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx b/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx index 98fb1455..89e77252 100644 --- a/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx +++ b/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx @@ -38,12 +38,6 @@ const highlightMatchedPhrases = (records: OptionWithSearchResult[]): OptionWithH } }) } - -const hasAnyMatchedPhraseLongerThan = (searchResult: OptionWithSearchResult, length: number): boolean => { - const values = _.chunk(signatureFromSearchResult(searchResult).split("**"), 2).map(([txt, matched]) => matched ? matched.length >= length : null) - return values.reduce((acc, element) => acc || element) -} - export class DokkaFuzzyFilterComponent extends Select { componentDidUpdate(prevProps, prevState) { super.componentDidUpdate(prevProps, prevState) @@ -94,7 +88,7 @@ export class DokkaFuzzyFilterComponent extends Select { } }) - .filter((record: OptionWithSearchResult) => record.matched && (hasAnyMatchedPhraseLongerThan(record, 3) || filterPhrase.length < 3)) + .filter((record: OptionWithSearchResult) => record.matched) this.props.onFilter(filterPhrase) -- cgit