[ 
https://issues.apache.org/jira/browse/OFBIZ-12680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580321#comment-17580321
 ] 

sourabh jain commented on OFBIZ-12680:
--------------------------------------

Created PR of the enhancement. PFA: [GitHub Pull Request 
#535|https://github.com/apache/ofbiz-framework/pull/535]

Optimized the 'get average product rating' method logic.

Done following:
- Enhanced and optimized the OOTB 'get average product rating' method logic and 
updated its references.
- Updated the 'get average product rating' method logic and optimized the logic 
by using dynamic entity using 'average' function to get the average rather than 
iterating all the product reviews.
- Updated the service parameter and updated all the references to add 
'delegator' as the new parameter.

> Optimize the 'get average product rating' method logic
> ------------------------------------------------------
>
>                 Key: OFBIZ-12680
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12680
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: product
>    Affects Versions: 18.12.06
>            Reporter: sourabh jain
>            Assignee: sourabh jain
>            Priority: Major
>             Fix For: 18.12.06
>
>
> *#Problem*: When calculating the average product rating for any product, the 
> 'get average product rating' method first retrieves the whole list of reviews 
> and then iterates all product reviews to determine.
> The approach takes time to respond when there are thousands of reviews of a 
> single product. It takes significantly longer to display many products 
> together with their reviews. (e.g. search result page)
> *#Solution*: We can use the 'average' function to get the average rather than 
> iterating all the product reviews.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to