Commit 8e89cd29 authored by 刘基明's avatar 刘基明

推荐列表merge fix

parent ebe77e41
......@@ -169,7 +169,7 @@ public class RecommendService {
// 按照 6,3,1的比例
private List<String> mergeRecommend(List<String> hotIds, List<String> newestIds, List<String> recmdIds) {
List<String> retList = new ArrayList<>();
HashSet<String> set = new HashSet<>();
int round = 0;
while (true) {
......@@ -179,9 +179,10 @@ public class RecommendService {
if (hotStart >= hotIds.size() && newestStart >= newestIds.size() && recmdStart >= recmdIds.size()) {
break;
}
retList.addAll(BizUtils.subList(newestIds, newestStart, newestStart + newRatio));
retList.addAll(BizUtils.subList(hotIds, hotStart, hotStart + hotRatio));
retList.addAll(BizUtils.subList(recmdIds, recmdStart, recmdStart + pythonRatio));
retList.addAll(BizUtils.subList(newestIds, newestStart, newRatio));
retList.addAll(BizUtils.subList(hotIds, hotStart, hotRatio));
retList.addAll(BizUtils.subList(recmdIds, recmdStart, pythonRatio));
set.addAll(retList);
round++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment