Question

I am dealing with a huge problem. I need to fetch a wall with information from mainly two tables: posts and events.

This information has to be ordered so that the most interesting is in top (like Facebooks own newsfeed).

I wish to order this information based on other tables such as which user the current user likes the most; like which user is MOST interesting (in form of following and liking his posts) and then put it in top.

I have thought of a system like described here: Algorithm of most relevant wall posts - but after a while, it seems too messy, and will require me to load ALL posts from the database, which eventually will be very much data, and THEN handle all the data each by each.

Do anyone have any experience with this? So that I can get pointed in the right direction.

Was it helpful?

Solution

I deal with exactly the same problem and the approach is same as explained by @relentless

  1. Find all the associations of the current user
  2. Sort by number of likes

However this looks very good in theory, but in practice in my case it required more time than the user was willing to wait.

So what I did is that I limited the number of the database records (posts and events in your case) to some amount that can be processed in like 2 second time-frame. In my case this was 6 months in the past, but in your case you have to tune the timing and the load to best suit your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top