A new API methods has been added in Ratings script service to allow computing back the average ratings when needed.
The signature of the method is the following:
/**
* Recompute the average rating of a reference.
* Note that this method can be resource consuming if the set of data is large.
*
* @param reference the reference for which to recompute the average ratings.
* @return the average rating in an optional or an empty optional in case of error.
* @since 13.7RC1
* @since 13.4.3
* @since 12.10.9
*/
@Unstable
@Programming
Optional<AverageRating> recomputeAverageRating(EntityReference reference)
* Recompute the average rating of a reference.
* Note that this method can be resource consuming if the set of data is large.
*
* @param reference the reference for which to recompute the average ratings.
* @return the average rating in an optional or an empty optional in case of error.
* @since 13.7RC1
* @since 13.4.3
* @since 12.10.9
*/
@Unstable
@Programming
Optional<AverageRating> recomputeAverageRating(EntityReference reference)