Authored by hugufei

直通车间隔改成动态配置

... ... @@ -249,13 +249,14 @@ public class UserRecallResponseBuilder {
// 3、插入【直通车】商品
iterator = sknResultList.iterator();
int index = 0;
int directTrainIndexInterval = searchDynamicConfigService.directTrainIndexInterval();
while (iterator.hasNext()) {
RecallMergerResult.SknResult sknResult = iterator.next();
// 生成插入位置-超出新列表的长度,则直接丢弃
int totalNewProductListSize = results.size();
int randomIndex = (int) (4 * (index++ + Math.random()));
int randomIndex = (int) (directTrainIndexInterval * (index++ + Math.random()));
if (randomIndex == 0 && !results.isEmpty()) {
randomIndex = 1;
randomIndex = 1;//不影响firstSkn
}
if (randomIndex <= totalNewProductListSize) {
results.add(randomIndex, sknResult);
... ...
... ... @@ -185,6 +185,16 @@ public class SearchDynamicConfigService {
}
/**
* 新的的召回策略-最多预测的品牌品类
*
* @return
*/
public int directTrainIndexInterval() {
return configReader.getInt("search.persional.newstrategy.directtrain.index.interval",4);
}
/**
* 新的的召回策略-召回来后是否再次进行品类品牌的平衡
*
* @return
... ... @@ -222,5 +232,5 @@ public class SearchDynamicConfigService {
public boolean isControllerCostLogOpen() {
return configReader.getBoolean("search.controller.cost.log.open", true);
}
}
... ...
... ... @@ -53,7 +53,11 @@ search.persional.newstrategy.open=true
search.persional.newstrategy.promotion.open=true
search.persional.newstrategy.first_page_cache.open=false
search.persional.newstrategy.common.join_score.open=true
search.persional.newstrategy.forecast.max_sort_brand.count=20
search.persional.newstrategy.realtime.max_sort_brand.count=20
search.persional.newstrategy.max_join_sort_brand.count=20
search.persional.newstrategy.directtrain.index.interval=4
search.persional.newstrategy.sort_brand_balance.open=false
#rateLimit
... ...