Skip to content

Commit f5e1b16

Browse files
committed
added better search parameters to hopefully get better search results
1 parent 4edcb00 commit f5e1b16

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Wox.Plugin.Choco.Tests/UnitTest1.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ public static void Initialize(TestContext context)
1919
public void QueryTest()
2020
{
2121
var main = new Main();
22-
var query = new Query("choco java");
22+
var query = new Query("choco Git");
2323

24-
main.Query(query);
24+
var results = main.Query(query);
25+
var resultCount = results.Count;
2526
}
2627

2728
[TestMethod]

Wox.Plugin.Choco/Main.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public List<Result> Query(Query query)
2424
d => d.id,
2525
(a, b, id) => new { package = a, result = b },
2626
null,
27-
null);
27+
null)
28+
.OrderByDescending(j => j.package.DownloadCount)
29+
.ToList();
2830
return joinResults.Select(j => CreatePackageListItem(j.package, j.result)).ToList();
2931
}
3032

Wox.Plugin.Choco/Parameters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class Parameters
1111
{
1212
public static string ImageFilePath = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location) + @"\Images\";
1313
public static string FilePrefix = @"_.jpeg";
14-
public static string SearchOptionTemplate = @"IsLatestVersion and ((substringof('{0}',tolower(Id)) eq true) or (substringof('{0}',tolower(Title)) eq true) or (substringof('{0}',tolower(Description)) eq true))";
14+
public static string SearchOptionTemplate = @"IsLatestVersion and ((substringof('{0}',tolower(Id)) eq true) or (substringof('{0}',tolower(Title)) eq true))";
1515
public static Uri ChocoWebApiUri = new Uri("https://chocolatey.org/api/v2/");
1616
public static string DefaultIconPath = Path.Combine(ImageFilePath, "icon.png");
1717
}

Wox.Plugin.Choco/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name":"Chocolatey",
55
"Description":"Use chocolatey from wox",
66
"Author":"blastdan",
7-
"Version":"1.0.0",
7+
"Version":"1.1.1",
88
"Language":"csharp",
99
"Website":"https://github.com/blastdan/Wox.Plugin.Choco",
1010
"IcoPath": "Images\\icon.png",

0 commit comments

Comments
 (0)