Authored by hugufei

添加是否返回goodsList的动态配置

... ... @@ -172,4 +172,11 @@ public class SearchDynamicConfigService {
return configReader.getBoolean("search.agg.brand.product.new", true);
}
/**
* aggProductListByBrand新实现
*/
public boolean productListReturnGoods() {
return configReader.getBoolean("search.productlist.return.goods", true);
}
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.search.service.index;
import com.alibaba.fastjson.JSONArray;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.common.SearchDynamicConfigService;
import com.yoho.search.service.helper.GoodsCoverHelper;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
... ... @@ -23,6 +24,8 @@ public class ProductIndexBaseService {
@Autowired
private GoodsCoverHelper goodsCoverHelper;
@Autowired
private SearchDynamicConfigService searchDynamicConfigService;
// 获取从source中不返回的字段定义,用以节省带宽
... ... @@ -167,7 +170,13 @@ public class ProductIndexBaseService {
productMap.put("sales_phrase", MapUtils.getString(map, ProductIndexEsField.salesPhrase, ""));
productMap.put("phrase", MapUtils.getString(map, ProductIndexEsField.phrase, ""));
productMap.put("status", MapUtils.getIntValue(map, ProductIndexEsField.status, 0));
productMap.put("goods_list", MapUtils.getObject(map, ProductIndexEsField.goodsList, new JSONArray()));
//测试环境zk配置改为false以不返回goods,刚上线默认还是要返回,等6.7上线后彻底删除
if(searchDynamicConfigService.productListReturnGoods()){
productMap.put("goods_list", MapUtils.getObject(map, ProductIndexEsField.goodsList, new JSONArray()));
}else{
productMap.put("goods_list",new JSONArray());
}
productMap.put("is_new", MapUtils.getString(map, ProductIndexEsField.isnew, "N"));
productMap.put("is_advance", MapUtils.getString(map, ProductIndexEsField.isAdvance, "N"));
... ...
# global configurations, ConfigReader will write this file to zookeeper.
#search direct downgrade, true:direct degrade, false:not direct degrade
search.degrade.direct.downgrade=false
#search open personalized based vector feature
search.personalized.vectorfeature.open=true
#search open personalized[true:open personalized, false:close personalized]
search.degrade.personalized.maxcount=20
#search.open.descorebrand[true:open descorebrand, false:close descorebrand]
search.degrade.open.descorebrand=true
#search.open.descorefield[true:open descorebrand, false:close descorebrand]
search.degrade.open.descorefield=true
#search.open.containglobal[true:contain global, false:not contain global anywhere]
search.degrade.open.containglobal=true
#search.open.degrade.descore.channel[true:degrade for channel , false:not degrade for channel]
search.degrade.descore.physicalchannel.open=true
search.degrade.descore.physicalchannel.value=0.6
#price plan
search.price.plan.open=true
#dynamic rule
search.dynamic.rule.open=false
#better search suggestion
search.suggestion.tips.open=true
search.suggestion.tips.conversion.open=true
#searchlike.not_in_shop.same_sort_percent
search.searchlike.not_in_shop.same_sort_percent=60
#searchlike
search.searchlike.similarskn=true
#log
search.controller.cost.log.open=true
#recommendbrand
search.recommendbrand.userPersonal.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.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.vector.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
search.persional.abTest.a.strategy.open=true
search.persional.abTest.b.strategy.open=true
#rateLimit
search.persional.rateLimit.open=true
search.persional.recommend.open=true
#rateLimit config
search.persional.rateLimit.brand.productList=200:2
search.persional.rateLimit.brand.aggregations=100:2
search.persional.rateLimit.breakSize.productList=200:2
search.persional.rateLimit.breakSize.aggregations=100:2
search.persional.rateLimit.common.productList=200:2
search.persional.rateLimit.common.aggregations=100:2
search.persional.rateLimit.coupon.productList=200:2
search.persional.rateLimit.coupon.aggregations=100:2
search.persional.rateLimit.fuzzy.productList=200:2
search.persional.rateLimit.fuzzy.aggregations=100:2
search.persional.rateLimit.newArrival.productList=200:2
search.persional.rateLimit.newArrival.aggregations=100:2
search.persional.rateLimit.pool.productList=200:2
search.persional.rateLimit.pool.aggregations=100:2
search.persional.rateLimit.promotion.productList=200:2
search.persional.rateLimit.promotion.aggregations=100:2
search.persional.rateLimit.reducePrice.productList=200:2
search.persional.rateLimit.shop.productList=200:2
search.persional.rateLimit.shop.aggregations=100:2
search.persional.rateLimit.sort.productList=200:2
search.persional.rateLimit.sort.aggregations=100:2
search.persional.rateLimit.zq.productList=200:2
search.persional.rateLimit.zq.aggregations=100:2
search.persional.rateLimit.group_brands=100:2
search.persional.rateLimit.group_shops=100:2
search.persional.rateLimit.search=100:2
search.persional.rateLimit.productindex.productList=100:2
search.persional.rateLimit.productindex.productListWithPhrase=100:2
search.persional.rateLimit.productindex.productListByPost=100:2
search.persional.rateLimit.productindex.goodProductList=100:2
search.persional.rateLimit.productindex.aggProductList=100:2
search.persional.rateLimit.productindex.aggProductListByBrand=100:2
search.persional.rateLimit.productindex.recommendShop=100:2
search.persional.rateLimit.productindex.aggRecommendBrand=100:2
search.tbl.use.new.index = true
search.shop.group.new=true
search.agg.brand.product.new=true
# global configurations, ConfigReader will write this file to zookeeper.
#search direct downgrade, true:direct degrade, false:not direct degrade
search.degrade.direct.downgrade=false
#search open personalized based vector feature
search.personalized.vectorfeature.open=true
#search open personalized[true:open personalized, false:close personalized]
search.degrade.personalized.maxcount=20
#search.open.descorebrand[true:open descorebrand, false:close descorebrand]
search.degrade.open.descorebrand=true
#search.open.descorefield[true:open descorebrand, false:close descorebrand]
search.degrade.open.descorefield=true
#search.open.containglobal[true:contain global, false:not contain global anywhere]
search.degrade.open.containglobal=true
#search.open.degrade.descore.channel[true:degrade for channel , false:not degrade for channel]
search.degrade.descore.physicalchannel.open=true
search.degrade.descore.physicalchannel.value=0.6
#price plan
search.price.plan.open=true
#dynamic rule
search.dynamic.rule.open=false
#better search suggestion
search.suggestion.tips.open=true
search.suggestion.tips.conversion.open=true
#searchlike.not_in_shop.same_sort_percent
search.searchlike.not_in_shop.same_sort_percent=60
#searchlike
search.searchlike.similarskn=true
#log
search.controller.cost.log.open=true
#recommendbrand
search.recommendbrand.userPersonal.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.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.vector.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
search.persional.abTest.a.strategy.open=true
search.persional.abTest.b.strategy.open=true
#rateLimit
search.persional.rateLimit.open=true
search.persional.recommend.open=true
#rateLimit config
search.persional.rateLimit.brand.productList=200:2
search.persional.rateLimit.brand.aggregations=100:2
search.persional.rateLimit.breakSize.productList=200:2
search.persional.rateLimit.breakSize.aggregations=100:2
search.persional.rateLimit.common.productList=200:2
search.persional.rateLimit.common.aggregations=100:2
search.persional.rateLimit.coupon.productList=200:2
search.persional.rateLimit.coupon.aggregations=100:2
search.persional.rateLimit.fuzzy.productList=200:2
search.persional.rateLimit.fuzzy.aggregations=100:2
search.persional.rateLimit.newArrival.productList=200:2
search.persional.rateLimit.newArrival.aggregations=100:2
search.persional.rateLimit.pool.productList=200:2
search.persional.rateLimit.pool.aggregations=100:2
search.persional.rateLimit.promotion.productList=200:2
search.persional.rateLimit.promotion.aggregations=100:2
search.persional.rateLimit.reducePrice.productList=200:2
search.persional.rateLimit.shop.productList=200:2
search.persional.rateLimit.shop.aggregations=100:2
search.persional.rateLimit.sort.productList=200:2
search.persional.rateLimit.sort.aggregations=100:2
search.persional.rateLimit.zq.productList=200:2
search.persional.rateLimit.zq.aggregations=100:2
search.persional.rateLimit.group_brands=100:2
search.persional.rateLimit.group_shops=100:2
search.persional.rateLimit.search=100:2
search.persional.rateLimit.productindex.productList=100:2
search.persional.rateLimit.productindex.productListWithPhrase=100:2
search.persional.rateLimit.productindex.productListByPost=100:2
search.persional.rateLimit.productindex.goodProductList=100:2
search.persional.rateLimit.productindex.aggProductList=100:2
search.persional.rateLimit.productindex.aggProductListByBrand=100:2
search.persional.rateLimit.productindex.recommendShop=100:2
search.persional.rateLimit.productindex.aggRecommendBrand=100:2
search.tbl.use.new.index = true
search.shop.group.new=true
search.agg.brand.product.new=true
search.productlist.return.goods=true
... ...