From 8cfd80b96228c15b4760d907ededb510dc61b674 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 30 Jul 2021 12:30:21 +1000 Subject: [PATCH] delay the create query helper call to catch exception when Windows Search service is not running --- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 6 +++--- .../Search/WindowsIndex/IndexSearch.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 9995f45d3..d367eddca 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -143,7 +143,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return await IndexSearch.WindowsIndexSearchAsync( querySearchString, - queryConstructor.CreateQueryHelper(), + queryConstructor.CreateQueryHelper, queryConstructor.QueryForFileContentSearch, Settings.IndexSearchExcludedSubdirectoryPaths, query, @@ -181,7 +181,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return await IndexSearch.WindowsIndexSearchAsync( querySearchString, - queryConstructor.CreateQueryHelper(), + queryConstructor.CreateQueryHelper, queryConstructor.QueryForAllFilesAndFolders, Settings.IndexSearchExcludedSubdirectoryPaths, query, @@ -195,7 +195,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return await IndexSearch.WindowsIndexSearchAsync( path, - queryConstructor.CreateQueryHelper(), + queryConstructor.CreateQueryHelper, queryConstructor.QueryForTopLevelDirectorySearch, Settings.IndexSearchExcludedSubdirectoryPaths, query, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index 010a19b58..2e90eadb6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -88,7 +88,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex internal async static Task> WindowsIndexSearchAsync( string searchString, - CSearchQueryHelper queryHelper, + Func createQueryHelper, Func constructQuery, List exclusionList, Query query, @@ -104,7 +104,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex var constructedQuery = constructQuery(searchString); return RemoveResultsInExclusionList( - await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper.ConnectionString, query, token).ConfigureAwait(false), + await ExecuteWindowsIndexSearchAsync(constructedQuery, createQueryHelper().ConnectionString, query, token).ConfigureAwait(false), exclusionList, token); }