Added relevancy lever based on comments scores of an article (#18352)
This commit is contained in:
parent
e358fdf347
commit
6297acbd5b
1 changed files with 15 additions and 0 deletions
|
|
@ -139,6 +139,20 @@ module Articles
|
|||
select_fragment: "articles.comments_count",
|
||||
group_by_fragment: "articles.comments_count")
|
||||
|
||||
relevancy_lever(:comments_score,
|
||||
label: "Weight given based on sum of comment scores of an article.",
|
||||
range: "[0..∞)",
|
||||
user_required: false,
|
||||
select_fragment: "SUM(
|
||||
CASE
|
||||
WHEN comments.score is null then 0
|
||||
ELSE comments.score
|
||||
END)",
|
||||
joins_fragments: ["LEFT OUTER JOIN comments
|
||||
ON comments.commentable_id = articles.id
|
||||
AND comments.commentable_type = 'Article'
|
||||
AND comments.deleted = false"])
|
||||
|
||||
relevancy_lever(:daily_decay,
|
||||
label: "Weight given based on the relative age of the article",
|
||||
range: "[0..∞)",
|
||||
|
|
@ -311,6 +325,7 @@ module Articles
|
|||
very_positive_reaction_threshold
|
||||
positive_reaction_threshold
|
||||
])
|
||||
|
||||
relevancy_lever(:public_reactions,
|
||||
label: "Weight to give for the number of unicorn, heart, reading list reactions for article.",
|
||||
range: "[0..∞)",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue