I am utilizing the Voting API and the Fivestar module to allow users to vote on content. I am planning on using Views to sort these nodes by their votes but am getting a bit confused.

In Views I see the following filters being sent by the Voting API:
-Voting API percent vote value
-Voting API percent vote timestamp
-Voting API percent vote user
-Voting API percent vote result
-Voting API percent vote result (count)

Is there somewhere that what these mean is explained? I have no idea what values these are sending. If somebody could point me towards some doc of what these mean that would be very much appreciated!

Thanks!

Comments

eaton’s picture

Fivestar uses percentage voting. You want to sort by the results of the vote: use the "Voting API percent vote result (average)" field, and it should do the trick.
--
Lullabot! | Eaton's blog | VotingAPI discussion

--
Eaton — Partner at Autogram

StevenSokulski’s picture

Is there a way to take into account this sort of scenario:

Node 1 with 3 votes average 80%
Node 2 with 9 votes average 70%
Node 3 with 1 votes average 100%
Node 4 with 8 votes average 100%

According to this Node 3 and Node 4 have the same score, right? Is it possible to take that into account. I'm not sure how best to do it, but maybe something along the lines of limiting items with less than X votes would do it.

dmah’s picture

1) Create another relationship on 'Voting Results' and label it something like 'num_votes' filter data on 'Percent', 'Vote', and 'Count'.

2) Set both relationships to 'Require this relationship'.

3) Add two new filters. The first one for 'Voting API results: Function' in the relationship 'num_votes' and set the operator to 'Is equal to' and the value to 'count'.

4) Create a second filter for 'Voting API results: Value' in the relationship 'num_votes' and set the operator to 'Is less than' and the value to the minimum number of votes that you want.

geerlingguy’s picture

Just wanted to report that this works great for me - I was having trouble setting a vote threshold for my 'most popular' view on LOLSaints, but this fixed that problem. I'd still like to be able to give sort criteria some sort of weight, so, for instance, a node with 50 votes at 4.8 would rank higher than a node with 12 votes at 4.9...

__________________
Personal site: www.jeffgeerling.com

Pol’s picture