Rethinking the Logic of Topic Popularity Ranking
-
+1
I had asked something similar here:
https://community.nodebb.org/topic/16907/respect-all-topics-when-filtering-by-popularity-and-by-date/3?_=1709240346566I'm thinking of something like "Hot Topics", topics that has been most discussed in the past week for example.
-
@dave1904 said in Rethinking the Logic of Topic Popularity Ranking:
+1
I had asked something similar here:
https://community.nodebb.org/topic/16907/respect-all-topics-when-filtering-by-popularity-and-by-date/3?_=1709240346566I'm thinking of something like "Hot Topics", topics that has been most discussed in the past week for example.
I agree with you, but I believe we do not need another term, this is what currently used popular topics should be...
When you click "popular", you wouldn't want to know the ranking of the topics that are created in the last week, you would rather want to know what the forum users were discussing... hence the ranking should be based on the number of posts that are posted under a topic, regardless when the topic was initially created...
-
@razibal that might be tricky too... I believe NodeBB changed how that is calculated several times in the past... And usually very old topics have very very high view numbers (I believe that is related to bots)...
But it would certainly be useful for the most recent rankings (day / week / month)
-
@crazycells said in Rethinking the Logic of Topic Popularity Ranking:
When you click "popular", you wouldn't want to know the ranking of the topics that are created in the last week, you would rather want to know what the forum users were discussing... hence the ranking should be based on the number of posts that are posted under a topic, regardless when the topic was initially created...
I fully agree
-
@crazycells said in Rethinking the Logic of Topic Popularity Ranking:
I agree with you, but I believe we do not need another term
A formular for hot topics could be
( [number of replies] * 50 + [number of views] ) * high factor / ( [current time] - [time of topic creation] )^1.5
-
Similarly, for "monthly popular topics," the calculation should focus on the number of posts contributed to a topic within the last 30 days, disregarding its creation date. As long as a topic remains actively discussed by members, it should maintain its position on the popularity list.
I've made a change to implement this, going to test it a bit and see how it behaves. It is live on this forum https://community.nodebb.org/popular?term=monthly.
-
@baris said in Rethinking the Logic of Topic Popularity Ranking:
Similarly, for "monthly popular topics," the calculation should focus on the number of posts contributed to a topic within the last 30 days, disregarding its creation date. As long as a topic remains actively discussed by members, it should maintain its position on the popularity list.
I've made a change to implement this, going to test it a bit and see how it behaves. It is live on this forum https://community.nodebb.org/popular?term=monthly.
Thanks
-
It is based on how many posts are made in the last 30 days. Not sure what's going on with the fediverse topic, then again that topic shows 28 total posts but the db says 26
https://community.nodebb.org/popular?term=daily might be a better example.
Targeted Multi-User tagging
topic was started in 2023 but had posts today so it shows up inpopular?term=daily
-
@dave1904 said in Rethinking the Logic of Topic Popularity Ranking:
@baris Cool! How do you calculate it? It doesn't seem to be based on most posts at the moment?
edit: I was just confused, of course the number of posts isn't recalculated for a topic if you filter monthly.
yeah, it should be the most posts at the selected time frame...
I believe this is the relevant commit:
https://github.com/NodeBB/NodeBB/commit/038f726b2371a7c2c66ec21e6199b5f534e4d3ef
-
@baris what about "year"? I think there should be a step between 30 days and eternity
-
The problem with that is performance, the way we calculate this right now is to load all post ids made in the past 30 days and then find their topic ids and sort by the number of posts. If we allow a year then it will load all posts made in the past year to get the post counts for sorting.
-
@baris said in Rethinking the Logic of Topic Popularity Ranking:
The problem with that is performance, the way we calculate this right now is to load all post ids made in the past 30 days and then find their topic ids and sort by the number of posts. If we allow a year then it will load all posts made in the past year to get the post counts for sorting.
I see... how is "all time" calculated? maybe there is a shortcut from that calculation, rather than calculating from scratch ?
-
@crazycells All-time is easy because we don't do any calculations there.
Whenever a new post is made to a topic we increment a value for that topic in a sorted set called
topics:posts
.You can see topic id 180 has the most posts with 625.
When displaying all time we just load that sorted set from highest score to lowest. Since there is no time range it is a single db call.
-
@baris I see, of course you have a better understanding, but could you get the all-time popular topic list, and determine the first post id that was created after the one-year mark for each topic? Then, subtract that number from the total post count of the topic... and re-sort the list based on calculated value? It might not be perfect, but probably it will give something very similar to the real list?
Or, maybe this is a worse performance killer?
-
@crazycells yup not possible at the moment without loading everything.
-
@baris said in Rethinking the Logic of Topic Popularity Ranking:
@crazycells yup not possible at the moment without loading everything.
lol no problem at all.. please ignore me then... NodeBB is very fast right now and I like it this way , if this addition will cause any performance issues, it is better not to add it...
Thanks again for the new popularity rankings, I think it makes more sense this way...
-
hi @julian , right now, "uncategorized" fediverse posts are dominating the
/popular
page... is this intended?