Skip to content

Commit

Permalink
Many nugets are currently showing "This package has not been indexed …
Browse files Browse the repository at this point in the history
…yet" NuGet#1112
  • Loading branch information
maartenba committed Aug 6, 2015
1 parent ce1a423 commit f26abfe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NuGetGallery/Controllers/PackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using NuGetGallery.Configuration;
using NuGetGallery.Filters;
using NuGetGallery.Helpers;
using NuGetGallery.Infrastructure.Lucene;
using NuGetGallery.Packaging;
using PoliteCaptcha;

Expand Down Expand Up @@ -292,7 +293,8 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version
}
}

if (_searchService.ContainsAllVersions)
var externalSerachService = _searchService as ExternalSearchService;
if (_searchService.ContainsAllVersions && externalSerachService != null)
{
var isIndexedCacheKey = string.Format("IsIndexed_{0}_{1}", package.PackageRegistration.Id, package.Version);
var isIndexed = HttpContext.Cache.Get(isIndexedCacheKey) as bool?;
Expand All @@ -301,7 +303,7 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version
var searchFilter = SearchAdaptor.GetSearchFilter(
"id:\"" + package.PackageRegistration.Id + "\" AND version:\"" + package.Version + "\"",
1, null, SearchFilter.ODataSearchContext);
var results = await _searchService.Search(searchFilter);
var results = await externalSerachService.RawSearch(searchFilter);

isIndexed = results.Hits > 0;

Expand Down

0 comments on commit f26abfe

Please sign in to comment.