• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

How does "Top Rated" sort?

Lincoln Lehmann

New Member
Showcase
I have vendors that are being listed as "Top Rated" and it seems that they have not done that much on the site. Other vendors who post more... have more reviews etc are not being listed as "Top Rated".
What is it that this sort is looking at to order them?

eg) This sort order by "Top Rated" on my site does not reflect what I would consider to be correct as Vo Evolution is the most active with the most posts and more reviews. Yet they are listed 3rd. Styling Trio has not done anything on the site yet they continue to stay at the #1 spot.
Hair Makeup Review | I Do Mexico


Thanks
 
The Top Rated sort tab uses the 'rated' sort order clause in the Item Model. Only USER Reviews come into play with this (Author Reviews have no baring on this).

It primary sorts by the Rating Ave which is stored in the 'rating_avg' field of the Item (which uses the same algorithm as the XF Resource Manager does).
It then secondary sorts by Rating Count, which is stored in the 'rating_count' field of the Item
It then secondary sorts by Likes Count, which is stored in the 'likes' field of the Item
It then secondary sorts by View Count, which is stored in the 'item_view_count' field of the item

secondary sorts handle TIES... eg, if you have 5 items with a perfect 5.00 rating ave, it then goes to the 2nd sort type (which is Rating Count). If there are still ties, it uses the LIKES count for the item. If there are still ties, it uses the View Count. After that its however MySQL determines it (usually be date added).

Items with MORE of things like the number of ratings, number of likes, number of views are going to rank higher when TIED.

PHP:
    /**
     * Construct 'ORDER BY' clause
     *
     * @param array $fetchOptions (uses 'order' key)
     * @param string $defaultOrderSql Default order SQL
     *
     * @return string
     */
    public function prepareItemOrderOptions(array &$fetchOptions, $defaultOrderSql = '')
    {
        $choices = array(
            'recent' => 'item.date_added',
            'rated' => 'item.rating_avg %s, item.rating_count DESC, item.likes DESC, item.item_view_count DESC',
            'reviewed' => 'item.review_count %s, item.rating_avg DESC, item.likes DESC, item.item_view_count DESC',
            'popular' => 'item.item_view_count %s, item.rating_avg DESC',
            'liked' => 'item.likes %s, item.rating_avg DESC, item.item_view_count DESC',           
            'updated' => 'item.last_update',               
            'featured' => 'RAND() %s, item.last_update DESC',
            'atoz' => 'item.item_name',
            'random' => 'RAND()', // for customization only.  Not used in core!
        );
        return $this->getOrderByClause($choices, $fetchOptions, $defaultOrderSql);
    }
 
eg) This sort order by "Top Rated" on my site does not reflect what I would consider to be correct as Vo Evolution is the most active with the most posts and more reviews. Yet they are listed 3rd. Styling Trio has not done anything on the site yet they continue to stay at the #1 spot.
Hair Makeup Review | I Do Mexico
That listing does NOT have the TOP RATED tab on it. It has the Most REVIEWED (which is NOT the same as Top Rated).

Most Reviewed is based on REVIEW COUNT (not rating ave).

Primary for Most Reviewed is Review Count (which is the number of visible user reviews that have been made).
Secondary is is by Rating Ave, then Likes, then view count.

If you have several items with the same amount of reviews, then the secondary kicks in and aranges them by Rating Ave, likes and views.

That is the way this is designed. You should change to using the Top Rated Tab instead of the Most Reviewed as it sounds like that is what you are wanting.
 
Thanks.
I just removed the Top Rated tab and a few others. Didn't think they were sorting properly is why you no longer see them.
Appreciate the help... I'll stick with the more straight forward sorts that seem to put the correct vendors in the list that makes more sense.
 
Thanks Bob... I left the SQL developer role to become a photographer many years ago.
While it seems like I am forced to put on my coding gloves and hat once and a while... i will just keep it simple and put in the sort orders that work best for putting my top vendors on top! :)
Appreciate the stroll down code-lane.
Linkn
 
Back
Top