Q:

Magento : How to Reaggregate Reviews

I am trying to import reviews to our Magento 1.9V, so after finishing I noticed that stars aren't showing on product. I used this module to import reviews, also I edit extension to import stars in my custom rating option. And after I dig deep I found that:
1- In the Admin area:  
Summary Rating  isn't Available

2- In the database product is exist in review table.
3-In the database product is not exist in rating_option_vote_aggregated table.
So how we can re-aggregated value of imported review?

A:

I fix this matter a while a go, and here is what I did in /Model/Convert/Adapter/Reviewimport.php:
public function saveRow(array $data)
{
    $product_id = $data['entity_id'];
    if ($product_id) {
        if ($data['customer_id'] == '') {
            $customerid = NULL;
        }
        else {
            $customerid = $data['customer_id'];
        }
        $_review = Mage::getModel('review/review')
            ->setCreatedAt($data['created_at'])
            ->setEntityPkValue($product_id)
            ->setEntityId(1)
            ->setStatusId($data['status_id'])
            ->setTitle($data['title'])
            ->setDetail($data['detail'])
            ->setStoreId($data['store_id'])
            ->setStores($data['store_id'])
            ->setCustomerId($customerid)
            ->setNickname($data['nickname'])
            ->save();
        if ($data['option_id']) {
            Mage::getModel('rating/rating')
                ->setRatingId($data['option_id'])
                ->setReviewId($_review->getId())
                ->setCustomerId($customerid)
                ->addOptionVote($data['review_score'], $product_id);
        }
        $_review->aggregate();
    }
}

