Switch to using RepositorySearchScore table for search ranking
Should make search queries much, much faster as it contains the denormalized RAC data
This commit is contained in:
parent
9d781b25e5
commit
e5a009a777
1 changed files with 2 additions and 3 deletions
|
@ -471,9 +471,8 @@ def _get_sorted_matching_repositories(lookup_value, repo_kind='image', include_p
|
|||
|
||||
query = (query
|
||||
.switch(Repository)
|
||||
.join(RepositoryActionCount)
|
||||
.where(RepositoryActionCount.date >= last_week)
|
||||
.order_by(fn.Sum(RepositoryActionCount.count).desc()))
|
||||
.join(RepositorySearchScore)
|
||||
.order_by(RepositorySearchScore.score.desc()))
|
||||
|
||||
return query
|
||||
|
||||
|
|
Reference in a new issue