This repository has been archived by the owner on Sep 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from NuGet/anurse/1963-addupdatestosearchrankings
Fix NuGet/NuGetGallery#1963 by adding Updates to Search Ranking.
- Loading branch information
Showing
2 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/NuGet.Services.Work/Jobs/Scripts/SearchRanking_Overall.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
SELECT TOP(200) Dimension_Package.PackageId, SUM(DownloadCount) 'Downloads' | ||
SELECT TOP(200) Dimension_Package.PackageId, SUM(CASE WHEN Dimension_Operation.Operation = 'Install' THEN DownloadCount ELSE (0.5 * DownloadCount) END) 'Downloads' | ||
FROM Fact_Download | ||
INNER JOIN Dimension_Package ON Dimension_Package.Id = Fact_Download.Dimension_Package_Id | ||
INNER JOIN Dimension_Date ON Dimension_Date.Id = Fact_Download.Dimension_Date_Id | ||
INNER JOIN Dimension_Operation ON Dimension_Operation.Id = Fact_Download.Dimension_Operation_Id | ||
WHERE Dimension_Date.[Date] >= CONVERT(DATE, DATEADD(day, -42, GETDATE())) | ||
AND Dimension_Date.[Date] < CONVERT(DATE, GETDATE()) | ||
AND Dimension_Package.PackageListed = 1 | ||
AND Dimension_Operation.Operation = 'Install' | ||
AND (Dimension_Operation.Operation = 'Install' OR Dimension_Operation.Operation = 'Update') | ||
GROUP BY Dimension_Package.PackageId | ||
ORDER BY SUM(DownloadCount) DESC | ||
ORDER BY Downloads DESC |