yangxiaohui 10 months ago
parent
commit
c90da5a96e

+ 4 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountRateCorrelationStrategy.java

@@ -71,7 +71,10 @@ public class ViewCountRateCorrelationStrategy implements ScoreStrategy {
                     if (hisItem.isInnerAccount() && Objects.nonNull(hisItem.getViewCount())
                             && hisItem.getViewCount() > 0 && Objects.nonNull(hisItem.getAvgViewCount())
                             && hisItem.getAvgViewCount() > 0) {
-                        Double correlation = (hisItem.getCorrelation() + 1) / 2;
+                        Double correlation = 0.3D;
+                        if (hisItem.getCorrelation() > 0) {
+                            correlation = (hisItem.getCorrelation() + 1) / 2;
+                        }
                         maxAvgViewCount = Math.max(maxAvgViewCount, hisItem.getAvgViewCount());
                         if (hisItem.getItemIndex() == 1) {
                             showViewCountSumFirst += (hisItem.getViewCount() * correlation);