Calculate a data field

This is going to be a mouthful:
I have a database of products with a series of attributes that describe the product: Dry, Crisp, Spicy, Fruity, etc. These attributes are either “yes” or “no”.

User’s are able two “favourite” different products by clicking an icon. In the user database, all of the product attributes are weighted based on the user’s “favourites”. For instance, if all of the products the user has favourited are “fruity”, then the user’s “fruity weight” gets a score of 1.
If half of the products the user has favourited are “fruity”, then the user’s “fruity weight” gets a score of 0.5 . And so on. These “weights” are calculated every time a user adds or deletes a favourite to their “favourite list”.

The product database lastly has a field called “Score”. I want this field to be unique to each product and to each user. The "Score is calculated by a sum-product of the user’s attribute weight * the product’s attribute (as numeric 1 or 0). This is summed across all attributes to determine a score for that product.
What I want, is to display an ordered rank of the top 5 products (based on the user’s product score).