On my site users will be able to give a 1 to 5 rating for various different products. I want to show users other users that have rated products in a similar way.

So in simplistic terms, if the followong users rated a prodcut like so:

User A - 5 stars User B - 4 stars User C - 1 stars User D - 0 stars

Then User A and User B would be matched, and User C and User D would also be matched.

How sophisticated an algorithm is achievable with only drupal modules and minimal php? Ideally a point system would find the similarity / difference between users’ ratings for all the products that they have both rated, and then find the top 5 closest matches and rank them accordingly. Thanks

2 Answers 2


This module looks like it would do the trick. http://drupal.org/project/fivestar_rec

Details from its project page:

This module makes content recommendations based on users Fivestar votes. It provides two types of recommendations:

  • "Users who liked this also liked": Shows a list of nodes on a node's page. Recommendations are computed based on whether the the nodes received similar Fivestar ratings from users.
  • "Recommendations for you": Shows a list of recommended nodes to the current user based on the user's previous ratings. This is personalized recommendations to each particular user.

The recommendations are provided with the Views module and are fully customizable.


This should be achievable using some combination of Flag, Fivestar, and Views. You can use Views to find users that match criteria based on the current user. You shouldn't need any PHP, in theory at least.

  • Im not sure I need Flag. I was going to use Fivestar which uses the Voting API. How would I use Views for this? I know Views can do stuff like finding users with the same role, but can it do more complicated algorithm type stuff? Thanks
    – Evanss
    Aug 29, 2012 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.