Authored by hugufei

去除最大召回数的控制

... ... @@ -5,6 +5,7 @@ import com.yoho.search.base.utils.Transfer;
import com.yoho.search.core.personalized.PersonalizedSearch;
import com.yoho.search.core.personalized.models.SortPriceAreas;
import com.yoho.search.recall.beans.persional.ProductFeatureFactorHepler;
import com.yoho.search.recall.config.RecallConfigConstants;
import com.yoho.search.recall.config.RecallConfigService;
import com.yoho.search.recall.models.personal.UserFeatureFactor;
import com.yoho.search.recall.beans.cache.SknBaseInfoCacheBean;
... ... @@ -69,7 +70,7 @@ public class UserRecallResponseBuilder {
if (recallTotalPage == 0) {
recallTotalPage = 1;
}
int userMaxRecallCount = recallConfigService.getUserMaxRecallCount(userRecallRequest.getPageId());
int userMaxRecallCount = RecallConfigConstants.USER_MAX_RECALL_COUNT;
recallTotalPage = Math.min(recallTotalPage, userMaxRecallCount / pageSize);//为用户最多保留X个skn进缓存
sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize);
... ...
... ... @@ -2,7 +2,9 @@ package com.yoho.search.recall.config;
public class RecallConfigConstants {
public static int DEFAULT_PAGE_ID = 0;
public static final int USER_MAX_RECALL_COUNT = 300;//用户最大的召回数量
public static final int DEFAULT_PAGE_ID = 0;
public static final int SKN_COUNT_CONFIG_PAGE = 1;
public static final int SKN_COUNT_CONFIG_SORT = 2;
... ... @@ -14,11 +16,15 @@ public class RecallConfigConstants {
public static final String RT_SIM_SKN = "RT_SIM_SKN";
public static final String ADD_FLOW = "ADD_FLOW";
public static final String NEW_SHOP = "NEW_SHOP";
public static final String REC_S_B_COUNT = "REC_S_B_COUNT";
public static final String VEC_RNN_S_B_COUNT = "VEC_RNN_S_B_COUNT";
public static final String VEC_W2V_S_B_COUNT = "VEC_W2V_S_B_COUNT";
public static final String USER_MAX_RECALL_COUNT = "USER_MAX_RECALL_COUNT";
public static final String REC_SORT_BRAND = "REC_SORT_BRAND";
public static final String RNN_SORT_BRAND = "RNN_SORT_BRAND";
public static final String W2V_SORT_BRAND = "W2V_SORT_BRAND";
public static final String SORT = "SORT";
public static final String BRAND = "SORT";
}
... ...
... ... @@ -53,19 +53,6 @@ public class RecallConfigService {
return recallConfigServiceCommon.queryConfigSize(pageId, RecallConfigConstants.VEC_RNN_S_B_COUNT, 0);
}
/**
* 获取最大用户召回缓存的数量
*
* @param pageId
* @return
*/
public int getUserMaxRecallCount(int pageId) {
int size = recallConfigServiceCommon.queryConfigSize(pageId, RecallConfigConstants.USER_MAX_RECALL_COUNT, 300);
size = Math.max(size, 100);
size = Math.min(size, 300);
return size;
}
private String getStrategyConfiKey(StrategyEnum strategyEnum) {
if (strategyEnum.equals(StrategyEnum.REC_SKN)) {
return RecallConfigConstants.REC_SKN;
... ...