Showing
3 changed files
with
11 additions
and
17 deletions
@@ -5,6 +5,7 @@ import com.yoho.search.base.utils.Transfer; | @@ -5,6 +5,7 @@ import com.yoho.search.base.utils.Transfer; | ||
5 | import com.yoho.search.core.personalized.PersonalizedSearch; | 5 | import com.yoho.search.core.personalized.PersonalizedSearch; |
6 | import com.yoho.search.core.personalized.models.SortPriceAreas; | 6 | import com.yoho.search.core.personalized.models.SortPriceAreas; |
7 | import com.yoho.search.recall.beans.persional.ProductFeatureFactorHepler; | 7 | import com.yoho.search.recall.beans.persional.ProductFeatureFactorHepler; |
8 | +import com.yoho.search.recall.config.RecallConfigConstants; | ||
8 | import com.yoho.search.recall.config.RecallConfigService; | 9 | import com.yoho.search.recall.config.RecallConfigService; |
9 | import com.yoho.search.recall.models.personal.UserFeatureFactor; | 10 | import com.yoho.search.recall.models.personal.UserFeatureFactor; |
10 | import com.yoho.search.recall.beans.cache.SknBaseInfoCacheBean; | 11 | import com.yoho.search.recall.beans.cache.SknBaseInfoCacheBean; |
@@ -69,7 +70,7 @@ public class UserRecallResponseBuilder { | @@ -69,7 +70,7 @@ public class UserRecallResponseBuilder { | ||
69 | if (recallTotalPage == 0) { | 70 | if (recallTotalPage == 0) { |
70 | recallTotalPage = 1; | 71 | recallTotalPage = 1; |
71 | } | 72 | } |
72 | - int userMaxRecallCount = recallConfigService.getUserMaxRecallCount(userRecallRequest.getPageId()); | 73 | + int userMaxRecallCount = RecallConfigConstants.USER_MAX_RECALL_COUNT; |
73 | recallTotalPage = Math.min(recallTotalPage, userMaxRecallCount / pageSize);//为用户最多保留X个skn进缓存 | 74 | recallTotalPage = Math.min(recallTotalPage, userMaxRecallCount / pageSize);//为用户最多保留X个skn进缓存 |
74 | sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize); | 75 | sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize); |
75 | 76 |
@@ -2,7 +2,9 @@ package com.yoho.search.recall.config; | @@ -2,7 +2,9 @@ package com.yoho.search.recall.config; | ||
2 | 2 | ||
3 | public class RecallConfigConstants { | 3 | public class RecallConfigConstants { |
4 | 4 | ||
5 | - public static int DEFAULT_PAGE_ID = 0; | 5 | + public static final int USER_MAX_RECALL_COUNT = 300;//用户最大的召回数量 |
6 | + | ||
7 | + public static final int DEFAULT_PAGE_ID = 0; | ||
6 | 8 | ||
7 | public static final int SKN_COUNT_CONFIG_PAGE = 1; | 9 | public static final int SKN_COUNT_CONFIG_PAGE = 1; |
8 | public static final int SKN_COUNT_CONFIG_SORT = 2; | 10 | public static final int SKN_COUNT_CONFIG_SORT = 2; |
@@ -14,11 +16,15 @@ public class RecallConfigConstants { | @@ -14,11 +16,15 @@ public class RecallConfigConstants { | ||
14 | public static final String RT_SIM_SKN = "RT_SIM_SKN"; | 16 | public static final String RT_SIM_SKN = "RT_SIM_SKN"; |
15 | public static final String ADD_FLOW = "ADD_FLOW"; | 17 | public static final String ADD_FLOW = "ADD_FLOW"; |
16 | public static final String NEW_SHOP = "NEW_SHOP"; | 18 | public static final String NEW_SHOP = "NEW_SHOP"; |
17 | - | ||
18 | public static final String REC_S_B_COUNT = "REC_S_B_COUNT"; | 19 | public static final String REC_S_B_COUNT = "REC_S_B_COUNT"; |
19 | public static final String VEC_RNN_S_B_COUNT = "VEC_RNN_S_B_COUNT"; | 20 | public static final String VEC_RNN_S_B_COUNT = "VEC_RNN_S_B_COUNT"; |
20 | public static final String VEC_W2V_S_B_COUNT = "VEC_W2V_S_B_COUNT"; | 21 | public static final String VEC_W2V_S_B_COUNT = "VEC_W2V_S_B_COUNT"; |
21 | 22 | ||
22 | - public static final String USER_MAX_RECALL_COUNT = "USER_MAX_RECALL_COUNT"; | 23 | + |
24 | + public static final String REC_SORT_BRAND = "REC_SORT_BRAND"; | ||
25 | + public static final String RNN_SORT_BRAND = "RNN_SORT_BRAND"; | ||
26 | + public static final String W2V_SORT_BRAND = "W2V_SORT_BRAND"; | ||
27 | + public static final String SORT = "SORT"; | ||
28 | + public static final String BRAND = "SORT"; | ||
23 | 29 | ||
24 | } | 30 | } |
@@ -53,19 +53,6 @@ public class RecallConfigService { | @@ -53,19 +53,6 @@ public class RecallConfigService { | ||
53 | return recallConfigServiceCommon.queryConfigSize(pageId, RecallConfigConstants.VEC_RNN_S_B_COUNT, 0); | 53 | return recallConfigServiceCommon.queryConfigSize(pageId, RecallConfigConstants.VEC_RNN_S_B_COUNT, 0); |
54 | } | 54 | } |
55 | 55 | ||
56 | - /** | ||
57 | - * 获取最大用户召回缓存的数量 | ||
58 | - * | ||
59 | - * @param pageId | ||
60 | - * @return | ||
61 | - */ | ||
62 | - public int getUserMaxRecallCount(int pageId) { | ||
63 | - int size = recallConfigServiceCommon.queryConfigSize(pageId, RecallConfigConstants.USER_MAX_RECALL_COUNT, 300); | ||
64 | - size = Math.max(size, 100); | ||
65 | - size = Math.min(size, 300); | ||
66 | - return size; | ||
67 | - } | ||
68 | - | ||
69 | private String getStrategyConfiKey(StrategyEnum strategyEnum) { | 56 | private String getStrategyConfiKey(StrategyEnum strategyEnum) { |
70 | if (strategyEnum.equals(StrategyEnum.REC_SKN)) { | 57 | if (strategyEnum.equals(StrategyEnum.REC_SKN)) { |
71 | return RecallConfigConstants.REC_SKN; | 58 | return RecallConfigConstants.REC_SKN; |
-
Please register or login to post a comment