Sonya* Posted April 19 Posted April 19 (edited) I have a Pages database. It uses star rating (not reviews!). I have set sorting by rating in descending order: The sorting is weird, though: Item with 15x5 stars and 1x1 star. Item with 17x5 stars only. Item with 25x5 stars and 3x1 star. Item with 23x5 stars only. Item with 6x5 stars and 1x1 star. Item with 16x5 stars and 1x6 stars. Item with 7x7 stars and 7x7 stars. Does it make sense? Obviously, the item #4 should be placed at the very top, following by item #2. Should it not be sorted by average as total rating divided by number of votes? Or what is meant with Sort by Rating? Edited April 19 by Sonya* Maxxius 1
Marc Posted April 19 Posted April 19 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release. SeNioR- and Sonya* 1 1
Sonya* Posted April 19 Author Posted April 19 (edited) I can see the issue. Your code rounds the average rating to an integer. That's why there is no difference for the first 4 items and then the next two. You can see they have the same record_rating in the database. This is how you save it. The rating_average (rating_value/rating_hits) with decimal would make a difference. Edited April 19 by Sonya* Maxxius 1
Recommended Posts