Authored by 胡古飞

去除无用代码

... ... @@ -73,10 +73,6 @@ public class FunctionScoreSearchHelper {
functionScoreQueryBuilder.add(physicalChannelScore.getQueryBuilder(), ScoreFunctionBuilders.weightFactorFunction(physicalChannelScore.getWeight()));
}
}
// 针对屏蔽的品牌降分【目前没用】
if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) {
functionScoreQueryBuilder.add(QueryBuilders.termQuery("isForbiddenSortBrand", "1"), ScoreFunctionBuilders.weightFactorFunction(0));
}
functionScoreQueryBuilder.boostMode(CombineFunction.MULT);
return functionScoreQueryBuilder;
}
... ...
... ... @@ -82,36 +82,6 @@ public class SearchCommonHelper {
}
/**
* 是否需要对品牌降分
*
* @param paramMap
* @return
*/
public boolean isNeedDeScoreBrandSearch(Map<String, String> paramMap) {
// 如果品牌降分总开关未开启,则直接返回
if (!dynamicConfig.deScoreBrandOpen()) {
return false;
}
// 如果是按售价或者折扣排序或品牌也或店铺页,则降分不生效
String sortField = paramMap.get("order");
if (StringUtils.isNotBlank(sortField)) {
if (sortField.contains("sales_price")) {
return false;
}
if (sortField.contains("discount")) {
return false;
}
if (StringUtils.isNotBlank(paramMap.get("shop")) || StringUtils.isNotBlank(paramMap.get("brand"))) {
return false;
}
}
if ("Y".equals(paramMap.get(SearchRequestParams.PARAM_SEARCH_GLOBAL_DESCORE_BRAND))) {
return true;
}
return false;
}
/**
* 是否需要对频道降分
*
* @param paramMap
... ...
... ... @@ -152,11 +152,7 @@ public class SearchSortHelper {
if (searchCommonHelper.isNeedPersonalSearch(paramMap)) {
return true;
}
// 3、需要做降分处理时
if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) {
return true;
}
// 4、传了需要显示第一个SKN的参数过来时
// 3、传了需要显示第一个SKN的参数过来时
if (searchCommonHelper.isFirstProductSknSearch(paramMap)) {
return true;
}
... ...
... ... @@ -62,7 +62,6 @@ public class SearchRequestParams {
public static final String PARAM_SEARCH_ACT_REC = "act_rec"; // 是否推荐
public static final String PARAM_SEARCH_ACT_STATUS = "act_status"; // 状态
public static final String PARAM_SEARCH_GLOBAL_DESCORE_BRAND = "isAdjustBrandScore"; // 是否要对全局降分品牌进行降分
public static final String PARAM_SEARCH_GLOBAL_FILTER_BRAND = "isFilterDescoreBrand"; // 是否过滤掉全局降分品牌的商品
public static final String PARAM_TERM_SUGGESTION = "needSuggestion"; //当商品数量小于特定数值(如20条)是否返回分词推荐
... ...
... ... @@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=5000
#search
search.minimum.should.match=75%
search.operator=and
search.default.field=brandName.brandName_lowercase^2500,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,salesPhrase^50,marketPhrase^50,searchField_ansj^10,searchField,productSkn.productSkn_ansj,productSkn.productSkn_ik
search.default.field=brandName.brandName_lowercase^4000,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,salesPhrase^50,marketPhrase^50,searchField_ansj^10,searchField,productSkn.productSkn_ansj,productSkn.productSkn_ik
search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)
search.script.lang=groovy
... ...
... ... @@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=${search.index.translog.flush_threshol
#search
search.minimum.should.match=75%
search.operator=and
search.default.field=brandName.brandName_lowercase^2500,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,salesPhrase^50,marketPhrase^50,searchField_ansj^10,searchField,productSkn.productSkn_ansj,productSkn.productSkn_ik
search.default.field=brandName.brandName_lowercase^4000,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,salesPhrase^50,marketPhrase^50,searchField_ansj^10,searchField,productSkn.productSkn_ansj,productSkn.productSkn_ik
search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)
search.script.lang=groovy
... ...