Authored by hugufei

价格带由3个变为5个

... ... @@ -34,9 +34,9 @@ public class CommonRecallRequestBuilder{
//1.5) 兜底的召回
requests.add(this.buildCommonRequest(paramQueryFilter,pageSize));
//1.6) 页面人气的召回
requests.add(this.buildCommonHeatValueRequest(paramQueryFilter,SknCountConstants.COMMON_HEAT_VALUE));
requests.add(this.buildCommonHeatValueRequest(paramQueryFilter,SknCountConstants.COMMON_HEAT_VALUE_RECALL_COUNT));
//1.7) 页面点击率的召回
requests.add(this.buildCommonCtrValueRequest(paramQueryFilter,SknCountConstants.COMMON_CTR_VALUE));
requests.add(this.buildCommonCtrValueRequest(paramQueryFilter,SknCountConstants.COMMON_CTR_VALUE_RECALL_COUNT));
return requests;
}
... ...
... ... @@ -81,7 +81,7 @@ public class UserRecallResponseBuilder {
}
int recallTotal = sknResultList.size();
//10、打印日志
logSknResultList(userRecallRequest,sknList);
logSknResultList(userRecallRequest, sknList);
return new UserRecallResponse(total, recallTotal, recallTotalPage, sknList);
}
... ... @@ -159,30 +159,13 @@ public class UserRecallResponseBuilder {
}
/**
* @param userPriceAreas
* @param sknPriceArea
* @return
*/
private boolean isLikePriceArea(List<Integer> userPriceAreas, Integer sknPriceArea) {
try {
if (userPriceAreas == null || userPriceAreas.isEmpty()) {
return false;
}
return userPriceAreas.contains(sknPriceArea);
} catch (Exception e) {
RECALL_NEW_LOGGER.error(e.getMessage(), e);
return false;
}
}
/**
* 价格带左右各扩展一位
*
* @param userPriceAreas
* @param sknPriceArea
* @return
*/
private boolean isLikePriceAreaWithBStrategy(List<Integer> userPriceAreas, Integer sknPriceArea) {
private boolean isLikePriceArea(List<Integer> userPriceAreas, Integer sknPriceArea) {
Collections.sort(userPriceAreas);
int min = userPriceAreas.get(0);
int max = userPriceAreas.get(userPriceAreas.size() - 1);
... ... @@ -224,7 +207,7 @@ public class UserRecallResponseBuilder {
continue;
}
//2)如果是推荐出来的,则单独加分[以减分的方式依次保证顺序]
if (strategy.equals(StrategyEnum.REC_SKN)){
if (strategy.equals(StrategyEnum.REC_SKN)) {
sknResult.setScore((double) recommendSknIndex--);
continue;
}
... ... @@ -264,8 +247,8 @@ public class UserRecallResponseBuilder {
iterator.remove();
}
}
commonCtrValueResultList = CollectionUtils.safeSubList(commonCtrValueResultList, 0, pageSize);
commonHeatValueResultList = CollectionUtils.safeSubList(commonHeatValueResultList, 0, pageSize);
commonCtrValueResultList = CollectionUtils.safeSubList(commonCtrValueResultList, 0, SknCountConstants.COMMON_CTR_VALUE_RETURN_COUNT);
commonHeatValueResultList = CollectionUtils.safeSubList(commonHeatValueResultList, 0, SknCountConstants.COMMON_HEAT_VALUE_RETURN_COUNT);
sknResultList.addAll(commonCtrValueResultList);
sknResultList.addAll(commonHeatValueResultList);
//3.1:如果是数量少于一页,则加会兜底的数据
... ...
... ... @@ -5,8 +5,10 @@ public class SknCountConstants {
/**
* 单次召回的商品数量
*/
public static final int COMMON_HEAT_VALUE = 100;
public static final int COMMON_CTR_VALUE = 100;
public static final int COMMON_HEAT_VALUE_RECALL_COUNT = 100;
public static final int COMMON_HEAT_VALUE_RETURN_COUNT = 20;
public static final int COMMON_CTR_VALUE_RECALL_COUNT = 100;
public static final int COMMON_CTR_VALUE_RETURN_COUNT = 20;
public static final int FIRST_SKN = 1;
public static final int DIRECT_TRAIN_RECALL_COUNT = 100;
... ...