Skip to content

Commit

Permalink
(GH-668) Search should sort by version desc
Browse files Browse the repository at this point in the history
When searching against multiple versions, the search order should be by
id, then by version descending. This returns the results in the correct
order for folks to install.
  • Loading branch information
ferventcoder committed Mar 24, 2016
1 parent 4ddeea2 commit 528bcb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chocolatey/infrastructure.app/nuget/NugetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ private static IQueryable<IPackage> execute_package_search(ChocolateyConfigurati
{
if (isRemote)
{
return results.OrderBy(p => p.Id);
return results.OrderBy(p => p.Id).ThenByDescending(p => p.Version);
}
else
{
return results.Where(PackageExtensions.IsListed).OrderBy(p => p.Id).AsQueryable();
return results.Where(PackageExtensions.IsListed).OrderBy(p => p.Id).ThenByDescending(p => p.Version).AsQueryable();
}
}

Expand Down

0 comments on commit 528bcb1

Please sign in to comment.