NuGet/NuGetGallery — pull request #691 by TimLovellSmith (2012-12-13 02:00:10+00:00)
Title: Fix search sorting to work by total download count (not latest version)

Fix download count sorting in search results (which was accidentally regressed as part of search changes). Re-fix the null reference exception resulting from degenerate search queries and add unit test for the scenario. Also add unit tests for AnalysisHelperFacts since assumptions about its behavior were the indirect root cause of the bug.