Add the use of a SearchManager

This commit is contained in:
Jeremy Wu 2020-05-19 22:38:42 +10:00
parent 78b797e43b
commit 690d60b701
2 changed files with 13 additions and 10 deletions

View file

@ -1,10 +1,8 @@
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex;
using Flow.Launcher.Plugin.Explorer.Search;
using Flow.Launcher.Plugin.Explorer.ViewModels;
using Flow.Launcher.Plugin.Explorer.Views;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Controls;
@ -51,13 +49,7 @@ namespace Flow.Launcher.Plugin.Explorer
if (regexMatch.Success)
return results;
var queryConstructor = new QueryConstructor(_settings);
var searcher = new IndexSearcher(Context);
return searcher.WindowsIndexSearch(query.Search,
queryConstructor.CreateQueryHelper().ConnectionString,
queryConstructor.QueryForAllFilesAndFolders);
return new SearchManager(_settings, Context).Search(query.Search);
}
public void Save()

View file

@ -61,5 +61,16 @@ namespace Flow.Launcher.Plugin.Explorer.Search
return results;
}
internal List<Result> WindowsIndexFilesAndFoldersSearch(string querySearchString)
{
var queryConstructor = new QueryConstructor(_settings);
var searcher = new IndexSearcher(_context);
return searcher.WindowsIndexSearch(querySearchString,
queryConstructor.CreateQueryHelper().ConnectionString,
queryConstructor.QueryForAllFilesAndFolders);
}
}
}