mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: experiment with hot sort order (#25274)
This introduces a new experimental hot sort ordering. It attempts to float top conversations by first prioritizing a topics with lots of recent activity (likes and users responding) The schedule that updates hot topics is disabled unless the hidden site setting: `experimental_hot_topics` is enabled. You can control "decay" with `hot_topic_gravity` and `recency` with `hot_topics_recent_days` Data is stored in the new `topic_hot_scores` table and you can check it out on the `/hot` route once enabled. --------- Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This commit is contained in:
@@ -338,6 +338,14 @@ class TopicQuery
|
||||
create_list(:bookmarks) { |l| l.where("tu.bookmarked") }
|
||||
end
|
||||
|
||||
def list_hot
|
||||
create_list(:hot, unordered: true) do |topics|
|
||||
topics.joins("JOIN topic_hot_scores on topics.id = topic_hot_scores.topic_id").order(
|
||||
"topic_hot_scores.score DESC",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def list_top_for(period)
|
||||
score_column = TopTopic.score_column_for_period(period)
|
||||
create_list(:top, unordered: true) do |topics|
|
||||
|
||||
Reference in New Issue
Block a user