mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add logic for index search to search with partial item name
This commit is contained in:
parent
ea9992475e
commit
5b2f06bf10
2 changed files with 22 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.QuickFolderLinks;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
|
|
@ -54,13 +54,14 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
return new List<Result>();
|
||||
|
||||
results.Add(currentFolderResult);
|
||||
DirectoryInfoClassSearch,
|
||||
WindowsIndexExists,
|
||||
query,
|
||||
querySearch);
|
||||
}
|
||||
|
||||
return WindowsIndexFilesAndFoldersSearch(query, querySearch);
|
||||
results.AddRange(TopLevelFolderSearchBehaviour(WindowsIndexTopLevelFolderSearch,
|
||||
DirectoryInfoClassSearch,
|
||||
WindowsIndexExists,
|
||||
query,
|
||||
querySearch));
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
private List<Result> DirectoryInfoClassSearch(Query query, string querySearch)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,20 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
|
|||
///</summary>
|
||||
public string QueryWhereRestrictionsForTopLevelDirectorySearch(string path)
|
||||
{
|
||||
return $"directory='file:{path}'";
|
||||
var directoryWhereRestriction = $"directory='file:";
|
||||
|
||||
if (path.EndsWith("\\"))
|
||||
return directoryWhereRestriction + $"{path}'";
|
||||
|
||||
var indexOfSeparator = path.LastIndexOf('\\');
|
||||
|
||||
var itemName = path.Substring(indexOfSeparator + 1);
|
||||
|
||||
var previousLevelDirectory = path.Substring(0, indexOfSeparator);
|
||||
|
||||
return $"(System.FileName LIKE '{itemName}%' " +
|
||||
$"OR CONTAINS(System.FileName,'\"{itemName}*\"',1033)) AND " +
|
||||
directoryWhereRestriction + $"{previousLevelDirectory}'";
|
||||
}
|
||||
|
||||
///<summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue