Skip to content

Commit

Permalink
(GH-1322) Fix: search - exact ignores page/page-size
Browse files Browse the repository at this point in the history
Due to some changes in the way that 0.10.6 worked to allow for GH-1004
to always return results with info and exact searches, page size and
page was being ignored. Fortunately limiting results is supported - even
though it does need to call completely through and then filter locally.
  • Loading branch information
ferventcoder committed Jun 4, 2017
1 parent 8d1f4e1 commit bfcd45d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/chocolatey/infrastructure.app/nuget/NugetList.cs
Expand Up @@ -60,16 +60,16 @@ private static IQueryable<IPackage> execute_package_search(ChocolateyConfigurati

IQueryable<IPackage> results = packageRepository.Search(searchTermLower, configuration.Prerelease);

if (configuration.ListCommand.Page.HasValue)
{
results = results.Skip(configuration.ListCommand.PageSize * configuration.ListCommand.Page.Value).Take(configuration.ListCommand.PageSize);
}

if (configuration.ListCommand.Exact)
{
results = packageRepository.FindPackagesById(searchTermLower).AsQueryable();
}

if (configuration.ListCommand.Page.HasValue)
{
results = results.Skip(configuration.ListCommand.PageSize * configuration.ListCommand.Page.Value).Take(configuration.ListCommand.PageSize);
}

if (configuration.ListCommand.ByIdOnly)
{
results = isRemote ?
Expand Down

0 comments on commit bfcd45d

Please sign in to comment.