@@ -69,36 +69,35 @@ internal async Task<List<Result>> SearchAsync(Query query, CancellationToken tok
69
69
switch ( isPathSearch )
70
70
{
71
71
case true
72
- when ( ActionKeywordMatch ( query , Settings . ActionKeyword . PathSearchActionKeyword )
73
- || ActionKeywordMatch ( query , Settings . ActionKeyword . SearchActionKeyword ) ) :
72
+ when ActionKeywordMatch ( query , Settings . ActionKeyword . PathSearchActionKeyword )
73
+ || ActionKeywordMatch ( query , Settings . ActionKeyword . SearchActionKeyword ) :
74
+
74
75
results . UnionWith ( await PathSearchAsync ( query , token ) . ConfigureAwait ( false ) ) ;
76
+
75
77
return results . ToList ( ) ;
76
- break ;
77
- case false when ActionKeywordMatch ( query , Settings . ActionKeyword . FileContentSearchActionKeyword ) :
78
- {
79
- // A backdoor to prevent everything to do content search
78
+
79
+ case false
80
+ when ActionKeywordMatch ( query , Settings . ActionKeyword . FileContentSearchActionKeyword ) :
81
+
82
+ // Intentionally require enabling of Everything's content search due to its slowness
80
83
if ( Settings . ContentIndexProvider is EverythingSearchManager && ! Settings . EnableEverythingContentSearch )
81
- {
82
84
return EverythingContentSearchResult ( query ) ;
83
- }
85
+
84
86
searchResults = Settings . ContentIndexProvider . ContentSearchAsync ( "" , query . Search , token ) ;
87
+
85
88
break ;
86
- }
89
+
87
90
case false :
88
91
searchResults = Settings . IndexProvider . SearchAsync ( query . Search , token ) ;
92
+
89
93
break ;
90
94
}
91
95
92
-
93
96
if ( searchResults == null )
94
- {
95
97
return results . ToList ( ) ;
96
- }
97
98
98
99
await foreach ( var search in searchResults . WithCancellation ( token ) . ConfigureAwait ( false ) )
99
- {
100
100
results . Add ( ResultManager . CreateResult ( query , search ) ) ;
101
- }
102
101
103
102
results . RemoveWhere ( r => Settings . IndexSearchExcludedSubdirectoryPaths . Any (
104
103
excludedPath => r . SubTitle . StartsWith ( excludedPath . Path , StringComparison . OrdinalIgnoreCase ) ) ) ;
0 commit comments