@Override
    public void addSortToSql(final SqlBuilder sql, final boolean sortDesc) {
        sql.addOrder(sql.getMainTableId() + ".rating", !sortDesc);
    }
Add some artificial average ratings to weight caches with few ratings towards the average rating.
main/src/main/java/cgeo/geocaching/sorting/RatingComparator.java