...
|
...
|
@@ -3,6 +3,7 @@ package com.yoho.search.service.recall; |
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
...
|
...
|
@@ -180,15 +181,20 @@ public class CommonSceneProductListService { |
|
|
List<String> firstProductSkns = Arrays.asList(MapUtils.getString(paramMap, SearchRequestParams.PARAM_SEARCH_FIRST_PRODUCRSKN, "").split(","));
|
|
|
for (CommonRecallSkn commonRecallSkn : commonRecallResult.getRecallSknList()) {
|
|
|
if (firstProductSkns.contains(String.valueOf(commonRecallSkn.getProductSkn()))) {
|
|
|
commonRecallSkn.setScore(10000);// firstSkn排第一个
|
|
|
commonRecallSkn.setScore(10000d);// firstSkn排第一个
|
|
|
} else {
|
|
|
commonRecallSkn.setScore(productFeatureFactorHepler.calProductFeatureFactor(userFeatureFactor, commonRecallSkn.getProductFeatureFactor()));
|
|
|
}
|
|
|
}
|
|
|
Collections.sort(commonRecallResult.getRecallSknList());
|
|
|
Collections.sort(commonRecallResult.getRecallSknList(),new Comparator<CommonRecallSkn>() {
|
|
|
@Override
|
|
|
public int compare(CommonRecallSkn o1, CommonRecallSkn o2) {
|
|
|
return o2.getScore().compareTo(o1.getScore());//大的排前面
|
|
|
}
|
|
|
});
|
|
|
return commonRecallResult;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 非个性化的列表接口-去除uid缓存
|
|
|
*
|
...
|
...
|
|