Skip to content

Commit

Permalink
added better search parameters to hopefully get better search results
Browse files Browse the repository at this point in the history
  • Loading branch information
blastdan committed Jul 13, 2015
1 parent 4edcb00 commit f5e1b16
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Wox.Plugin.Choco.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public static void Initialize(TestContext context)
public void QueryTest()
{
var main = new Main();
var query = new Query("choco java");
var query = new Query("choco Git");

main.Query(query);
var results = main.Query(query);
var resultCount = results.Count;
}

[TestMethod]
Expand Down
4 changes: 3 additions & 1 deletion Wox.Plugin.Choco/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public List<Result> Query(Query query)
d => d.id,
(a, b, id) => new { package = a, result = b },
null,
null);
null)
.OrderByDescending(j => j.package.DownloadCount)
.ToList();
return joinResults.Select(j => CreatePackageListItem(j.package, j.result)).ToList();
}

Expand Down
2 changes: 1 addition & 1 deletion Wox.Plugin.Choco/Parameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class Parameters
{
public static string ImageFilePath = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location) + @"\Images\";
public static string FilePrefix = @"_.jpeg";
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))";
public static string SearchOptionTemplate = @"IsLatestVersion and ((substringof('{0}',tolower(Id)) eq true) or (substringof('{0}',tolower(Title)) eq true))";
public static Uri ChocoWebApiUri = new Uri("https://chocolatey.org/api/v2/");
public static string DefaultIconPath = Path.Combine(ImageFilePath, "icon.png");
}
Expand Down
2 changes: 1 addition & 1 deletion Wox.Plugin.Choco/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name":"Chocolatey",
"Description":"Use chocolatey from wox",
"Author":"blastdan",
"Version":"1.0.0",
"Version":"1.1.1",
"Language":"csharp",
"Website":"https://github.com/blastdan/Wox.Plugin.Choco",
"IcoPath": "Images\\icon.png",
Expand Down

0 comments on commit f5e1b16

Please sign in to comment.