Skip to content
This repository has been archived by the owner on Sep 5, 2018. It is now read-only.

Commit

Permalink
Merge pull request #11 from NuGet/anurse/1963-addupdatestosearchrankings
Browse files Browse the repository at this point in the history
Fix NuGet/NuGetGallery#1963 by adding Updates to Search Ranking.
  • Loading branch information
analogrelay committed Mar 18, 2014
2 parents 3d9a8b3 + 5432a5f commit a236e30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
Expand All @@ -7,7 +7,7 @@ INNER JOIN Dimension_Project ON Dimension_Project.Id = Fact_Download.Dimension_P
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')
AND Dimension_Project.ProjectTypes = @ProjectGuid
GROUP BY Dimension_Package.PackageId
ORDER BY SUM(DownloadCount) DESC
ORDER BY Downloads DESC
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

0 comments on commit a236e30

Please sign in to comment.