How to sort content by "recently popular"

Hi Bubblers,

My goal is to achieve something similar to a reddit front page or “trending topics” (with a much less complex algorithm). Are there any examples or suggestions on how to best achieve this?

Here’s my current data structure:

There are Ideas which are a data type that Users can create. Ideas can be voted on and those votes are stored in the Upvotes field (list of users) in the Idea. There is also a separate VoteCount field (number) in the Idea that is incremented with each vote, which is currently used for sorting.

With this I am able to organize ideas by VoteCount, however what I am hoping to do is create a “Recently Popular” sort which would show items that have X # of votes within a defined time range. For example, show all Ideas sorted by votes received in the last day (…week, month, etc).

I suppose one thing I could do is create a separate table for votes, reference the original idea, and then filter to a time range and group by idea? However, that would show limited results if there were only a few votes on that day. However, this would also limit the number of results to the ideas that received votes. Is there a way I could guarantee a set number of unique ideas based on recent votes?

Thanks in advance,
Paul

This topic was automatically closed after 70 days. New replies are no longer allowed.