How to store a nodes Fivestar average rating inside another field with computed fields In order use rating to sort on inside search api, i'm trying to store the fivestar decimal value inside another field that can be indexed. This is because Fivestar doesn't play nice with search_api, so this will be a workaround.

I have a computed field that performs different tasks on the node such as copying the field_review_votes_average to field_index_review_score. I'm using this code to do so.

$entity-&gt;field_index_review_score[LANGUAGE_NONE][0]['value'] = $entity-&gt;field_review_votes_average[LANGUAGE_NONE][0]['average'];


But I keep getting Notice: Undefined index: und, what code can I use to to retrieve the average score?
Eventualy I used a different methode to get the average value. Here's how

 //Get average rating and place in index review score
    $average_field = field_view_field('node', $entity, 'field_review_votes_average');
    $rating = $average_field['#items'][0]['average'];
$entity-&gt;field_index_review_score['und'][0]['value'] = $rating;