From 3e513e2387d1fb0efb636f622dfc2a84febf23d3 Mon Sep 17 00:00:00 2001 From: Xavier Decoster Date: Wed, 3 May 2017 22:56:05 +0200 Subject: [PATCH] LuceneIndexingService in Gallery should take into account IsLatest(Stable)SemVer2 (#3863) --- .../Infrastructure/Lucene/LuceneIndexingService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs index d126816b40..fd963f35b7 100644 --- a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs +++ b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs @@ -142,16 +142,16 @@ private List GetPackages(DateTime? lastIndexTime) if (lastIndexTime.HasValue) { - // Retrieve the Latest and LatestStable version of packages if any package for that registration changed since we last updated the index. + // Retrieve the Latest, LatestStable, LatestSemVer2 and LatestStableSemVer2 version of packages if any package for that registration changed since we last updated the index. // We need to do this because some attributes that we index such as DownloadCount are values in the PackageRegistration table that may // update independent of the package. set = set.Where( - p => (p.IsLatest || p.IsLatestStable) && + p => (p.IsLatest || p.IsLatestStable || p.IsLatestSemVer2 || p.IsLatestStableSemVer2) && p.PackageRegistration.Packages.Any(p2 => p2.LastUpdated > lastIndexTime)); } else { - set = set.Where(p => p.IsLatest || p.IsLatestStable); // which implies that p.IsListed by the way! + set = set.Where(p => p.IsLatest || p.IsLatestStable || p.IsLatestSemVer2 || p.IsLatestStableSemVer2); // which implies that p.IsListed by the way! } var list = set