mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Merge pull request #88 from microsoft/extractBasedOnTitle
Searches for keyword only in title and Improving quality of results displayed
This commit is contained in:
@@ -58,7 +58,7 @@ namespace Wox.Plugin.Indexer
|
|||||||
workingDir = Path.GetDirectoryName(path);
|
workingDir = Path.GetDirectoryName(path);
|
||||||
|
|
||||||
Result r = new Result();
|
Result r = new Result();
|
||||||
r.Title = Path.GetFileName(path);
|
r.Title = searchResult.Title;
|
||||||
r.SubTitle = path;
|
r.SubTitle = path;
|
||||||
r.IcoPath = path;
|
r.IcoPath = path;
|
||||||
r.Action = c =>
|
r.Action = c =>
|
||||||
|
|||||||
@@ -10,5 +10,9 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
|||||||
{
|
{
|
||||||
// Contains the Path of the file or folder
|
// Contains the Path of the file or folder
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
// Contains the Title of the file or folder
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,17 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
|||||||
{
|
{
|
||||||
if(WDSResults.HasRows)
|
if(WDSResults.HasRows)
|
||||||
{
|
{
|
||||||
while (WDSResults.Read() && WDSResults.GetValue(0) != DBNull.Value)
|
while (WDSResults.Read())
|
||||||
{
|
{
|
||||||
var result = new SearchResult { Path = WDSResults.GetString(0) };
|
if(WDSResults.GetValue(0) != DBNull.Value && WDSResults.GetValue(1) != DBNull.Value)
|
||||||
_Result.Add(result);
|
{
|
||||||
|
var result = new SearchResult
|
||||||
|
{
|
||||||
|
Path = WDSResults.GetString(0),
|
||||||
|
Title = WDSResults.GetString(1)
|
||||||
|
};
|
||||||
|
_Result.Add(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,6 +95,9 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
|||||||
// Set additional query restriction
|
// Set additional query restriction
|
||||||
queryHelper.QueryWhereRestrictions = "AND scope='file:'";
|
queryHelper.QueryWhereRestrictions = "AND scope='file:'";
|
||||||
|
|
||||||
|
// To filter based on title for now
|
||||||
|
queryHelper.QueryContentProperties = "System.Title";
|
||||||
|
|
||||||
// Set sorting order
|
// Set sorting order
|
||||||
queryHelper.QuerySorting = "System.DateModified DESC";
|
queryHelper.QuerySorting = "System.DateModified DESC";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user