Authored by hugufei

first_productskn的bug

... ... @@ -24,12 +24,12 @@ public class CommonRecallRequestBuilder extends BaseRecallRequest {
public List<RecallRequest> buildCommonRecallRequests(ParamQueryFilter paramQueryFilter, List<String> firstProductSkns, int pageSize) {
//1、构造召回请求
List<RecallRequest> requests = new ArrayList<>();
//1.1) 人气的召回
requests.add(this.buildCommonRequest(paramQueryFilter, Math.min(2 * pageSize, SknCountConstants.COMMON)));
//1.2) firstSkn的召回
//1.1) firstSkn的召回
requests.add(this.buildFirstSknRequest(paramQueryFilter, firstProductSkns, SknCountConstants.FIRST_SKN));
//1.3) 直通车的召回
//1.2) 直通车的召回
requests.add(this.buildDirectTrainRequest(paramQueryFilter, SknCountConstants.DIRECT_TRAIN));
//1.3) 人气的召回
requests.add(this.buildCommonRequest(paramQueryFilter, Math.min(2 * pageSize, SknCountConstants.COMMON)));
//1.4) 新开店铺的召回
requests.add(this.buildNewShopRequest(paramQueryFilter, SknCountConstants.NEW_SHOP));
//1.5) 流量补偿的召回
... ...
... ... @@ -87,7 +87,6 @@ public class RecallResultBuilder {
for (RecallResponseBatch.SknResult sknResult : sknResultList) {
if (sknResult.getRequestTypes().contains(StrategyNameEnum.FIRST_PRODUCT_SKN.name())) {
sknResult.setScore(10000d);// firstSkn排第一个
sknResult.setScore(Math.random());
} else {
sknResult.setScore(Math.random());
}
... ...
package com.yoho.search.recall.scene.strategy.impls;
import com.alibaba.fastjson.JSON;
import com.yoho.search.recall.scene.constants.CacheTimeConstants;
import com.yoho.search.recall.scene.helper.ExtendFilterHelper;
import com.yoho.search.recall.scene.helper.SortBuilderHelper;
... ... @@ -54,6 +55,7 @@ public class CommonFirstSknStrategy implements IStrategy {
@Override
public String strategyCacheKey() {
StringBuilder sb = defaultStrategyKey();
sb.append(this.firstSkns==null?"": JSON.toJSONString(this.firstSkns));
return sb.toString();
}
... ...