From 94c9d386325c14752cc241708257267bcf1a4bd5 Mon Sep 17 00:00:00 2001 From: Xavier Decoster Date: Wed, 3 May 2017 15:09:11 +0200 Subject: [PATCH 1/2] #3862 LuceneIndexingService in Gallery should take into account IsLatest(Stable)SemVer2 --- .../Infrastructure/Lucene/LuceneIndexingService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs index d126816b40..3ff8d02e3e 100644 --- a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs +++ b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs @@ -146,12 +146,12 @@ private List GetPackages(DateTime? lastIndexTime) // 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 From ce9a0a53bdbc63e0bd7ca40fd915e4a6504f61ce Mon Sep 17 00:00:00 2001 From: Xavier Decoster Date: Wed, 3 May 2017 19:50:55 +0200 Subject: [PATCH 2/2] Update comment to reflect code change --- src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs index 3ff8d02e3e..fd963f35b7 100644 --- a/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs +++ b/src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs @@ -142,7 +142,7 @@ 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(