Hi,

I have an issue with combination of Search API and Fivestar (Vote API). I currently use Database engine for Search API (while in development, probably use Solr in production).
I can add fivestar > average rating as related field. Also I choose kind of index etc. Save, click on index. No problem.

However, it doesn't work when i try to sort on average rating. So I checked in database, where I can see that no values at all have been indexed:

mysql> SELECT * FROM search_api_db_index_field_fivestar_rating_average_rating;
+---------+-------+
| item_id | value |
+---------+-------+
|       7 |     0 |
|      10 |     0 |
|      12 |     0 |
|      15 |     0 |
|      17 |     0 |
etc...

Anyone got any idea of how to solve this? This is quite critical for me, but don't really have any clue to way this happens.

Comments

BeaPower’s picture

Same issue as well...

drunken monkey’s picture

Priority: Major » Normal

Did you index after there were ratings? If you index before, the average will of course be 0 (or, indeed, arbitrary). (You'll therefore probably need some mechanism to index the entities periodically, even if they themselves don't change.)

If you're sure that that isn't the problem, please move this issue to the Fivestar module. It would then seem that their property getter callback doesn't return the right values (at least in this situation).

Zahak’s picture

Yes, ratings were there before indexing. I'll see what they say. Also, I'll probably try to get some time to do some research myself.

Zahak’s picture

Status: Active » Closed (works as designed)

Seems like they are debating the issue here: #1256572: Integrate with Entity API.