@@ -13,20 +13,17 @@ internal static List<Result> AccessLinkListMatched(Query query, IEnumerable<Acce
13
13
if ( string . IsNullOrEmpty ( query . Search ) )
14
14
return new List < Result > ( ) ;
15
15
16
- string search = query . Search . ToLower ( ) ;
17
-
18
- var queriedAccessLinks =
19
- accessLinks
20
- . Where ( x => x . Name . Contains ( search , StringComparison . OrdinalIgnoreCase ) || x . Path . Contains ( search , StringComparison . OrdinalIgnoreCase ) )
16
+ return accessLinks
17
+ . Where ( x => Main . Context . API . FuzzySearch ( query . Search , x . Name ) . IsSearchPrecisionScoreMet ( ) || Main . Context . API . FuzzySearch ( query . Search , x . Path ) . IsSearchPrecisionScoreMet ( ) )
21
18
. OrderBy ( x => x . Type )
22
- . ThenBy ( x => x . Name ) ;
23
-
24
- return queriedAccessLinks . Select ( l => l . Type switch
25
- {
26
- ResultType . Folder => ResultManager . CreateFolderResult ( l . Name , l . Path , l . Path , query , quickAccessResultScore ) ,
27
- ResultType . File => ResultManager . CreateFileResult ( l . Path , query , quickAccessResultScore ) ,
28
- _ => throw new ArgumentOutOfRangeException ( )
29
- } ) . ToList ( ) ;
19
+ . ThenBy ( x => x . Name )
20
+ . Select ( l => l . Type switch
21
+ {
22
+ ResultType . Folder => ResultManager . CreateFolderResult ( l . Name , l . Path , l . Path , query , quickAccessResultScore ) ,
23
+ ResultType . File => ResultManager . CreateFileResult ( l . Path , query , quickAccessResultScore ) ,
24
+ _ => throw new ArgumentOutOfRangeException ( )
25
+ } )
26
+ . ToList ( ) ;
30
27
}
31
28
32
29
internal static List < Result > AccessLinkListAll ( Query query , IEnumerable < AccessLink > accessLinks )
0 commit comments