Optimize Articles::Suggest query (#13548)
This commit is contained in:
parent
f48cf141a6
commit
d8f7518e5c
1 changed files with 3 additions and 1 deletions
|
|
@ -46,7 +46,9 @@ module Articles
|
|||
end
|
||||
|
||||
def suggestions_by_tag(max: MAX_DEFAULT)
|
||||
Article.published.tagged_with(cached_tag_list_array, any: true)
|
||||
Article
|
||||
.published
|
||||
.cached_tagged_with_any(cached_tag_list_array)
|
||||
.where.not(user_id: article.user_id)
|
||||
.where(tag_suggestion_query)
|
||||
.order(hotness_score: :desc)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue