Authored by hugufei

添加search.persional.newstrategy.promotion.open动态配置

... ... @@ -124,17 +124,6 @@ public class SearchDynamicConfigService {
}
/**
* 品类页召回时使用的uid[尾数]
*/
public boolean isGoToSortRecallUser(int uid) {
String uidMantissas = configReader.getString("search.sortpage.recall.uid.mantissa", "0,1,2,3,4,5,6,7,8,9");
if (uidMantissas.contains(String.valueOf(uid % 10))) {
return true;
}
return false;
}
/**
* 品类页召回时是否使用全局品牌id
*/
public boolean isSortPageRecallUseGlobalBrand() {
... ... @@ -196,6 +185,15 @@ public class SearchDynamicConfigService {
}
/**
* 促销页使用新的的召回策略
*
* @return
*/
public boolean searchPersionalNewStrategyPromotionOpen() {
return configReader.getBoolean("search.persional.newstrategy.promotion.open", true);
}
/**
* 使用性能高的召回场景【双11打开】
*
* @return
... ...
... ... @@ -13,6 +13,7 @@ import com.yoho.search.recall.scene.beans.builder.RecallParamsBuilder;
import com.yoho.search.recall.scene.models.RecallParams;
import com.yoho.search.service.base.SearchCacheService;
import com.yoho.search.service.base.SearchCommonService;
import com.yoho.search.service.base.SearchDynamicConfigService;
import com.yoho.search.service.helper.ProductListHelper;
import com.yoho.search.service.helper.SearchCommonHelper;
import com.yoho.search.service.helper.SearchParamHelper;
... ... @@ -46,6 +47,8 @@ public class PromotionProductListService extends AbstractCacheAbleService {
private RecallParamsBuilder recallParamsBuilder;
@Autowired
private SceneRecallProductListService sceneRecallProductListService;
@Autowired
private SearchDynamicConfigService searchDynamicConfigService;
@Override
public SearchCache getSearchCache() {
... ... @@ -74,7 +77,7 @@ public class PromotionProductListService extends AbstractCacheAbleService {
BoolQueryBuilder promotionMustFilter = promotionSceneHelper.getMustFilterByPromotion(promotionConditions);
//3、个性化-走召回逻辑
if (searchCommonHelper.isPersionalScene(paramMap)) {
if (this.goRecallLogic(paramMap)) {
RecallParams promotionRecallParams = recallParamsBuilder.buildPromotionRecallParams(paramMap, promotionMustFilter, pageSize);
return sceneRecallProductListService.recallProductList(promotionRecallParams, page);
}
... ... @@ -83,6 +86,17 @@ public class PromotionProductListService extends AbstractCacheAbleService {
return this.defaultPromotionList(paramMap, promotionMustFilter, page, pageSize);
}
private boolean goRecallLogic(Map<String, String> paramMap){
if(!searchCommonHelper.isPersionalScene(paramMap)){
return false;
}
if(!searchDynamicConfigService.searchPersionalNewStrategyPromotionOpen()){
return false;
}
return true;
}
/**
* 默认的促销列表的返回方式
*
... ...
... ... @@ -3,9 +3,6 @@
#search direct downgrade, true:direct degrade, false:not direct degrade
search.degrade.direct.downgrade=false
#search open personalized[true:open personalized, false:close personalized]
search.degrade.open.personalized=true
#search open personalized based vector feature
search.personalized.vectorfeature.open=true
... ... @@ -38,14 +35,17 @@ search.suggestion.tips.conversion.open=true
#searchlike.not_in_shop.same_sort_percent
search.searchlike.not_in_shop.same_sort_percent=60
#recall
search.sortpage.recall.open=true
#persional
search.degrade.open.personalized=true
search.persional.performancestrategy.open=false
search.sortpage.recall.open=false
search.sortpage.recall.use_global_brand=false
search.sortpage.recall.brand.count=30
search.sortpage.recall.uid.mantissa=0,1,2,3,4,5,6,7,8,9
search.persional.newstrategy.open=false
search.persional.performancestrategy.open=false
search.persional.newstrategy.open=true
search.persional.newstrategy.promotion.open=true
#rateLimit
search.persional.rateLimit.open=true
... ...