Drupal 7 & Rules - How to update a node field every time a comment is edited/posted

689 Views Asked by At

I would like update a field in one of my nodes to reflect the average of all the fivestar ratings I have. However, I want it to be indexed and searcable by search api/solr.

So I thought I could use a Rule to average all of the rating fields after a new comment is added (nodes are rated by the Fivestar field in a comment) and then update an integer field of the node with this new average.

Of course i would need to also re-index this node using search api - so if you tips for that as well, that would be great!

1

There are 1 best solutions below

0
Nexotap On

What you want is already implemented in the FiveStarVoting Module.

Have a look here: http://drupal.org/node/1308114

Unfortunately there's a bug which you can follow here: http://drupal.org/node/1245700

I hope that helped you out.