Authored by hugufei

列表支持一键关闭个性化

@@ -130,47 +130,7 @@ public class FunctionScoreSearchHelper { @@ -130,47 +130,7 @@ public class FunctionScoreSearchHelper {
130 // 6、this.addIncraseScoreForBrandWithSort(functionScoreQueryBuilder); 130 // 6、this.addIncraseScoreForBrandWithSort(functionScoreQueryBuilder);
131 return scorers; 131 return scorers;
132 } 132 }
133 -  
134 - // // 对[品牌]加分  
135 - // private void addIncreaseScoreBrandIds(FunctionScoreQueryBuilder  
136 - // functionScoreQueryBuilder) {  
137 - // String brandIds = dynamicConfig.getIncreaseScoreBrandIds();  
138 - // if (StringUtils.isBlank(brandIds) || "-1".equals(brandIds)) {  
139 - // return;  
140 - // }  
141 - // String[] brandIdArr = brandIds.split(",");  
142 - // functionScoreQueryBuilder.add(QueryBuilders.termsQuery(ProductIndexEsField.brandId,  
143 - // brandIdArr),  
144 - // ScoreFunctionBuilders.weightFactorFunction(BRAND_INCREASE_SCORE_WEIGHT));  
145 - // }  
146 - //  
147 - // // 对[品牌+品类]加分  
148 - // private void addIncraseScoreForBrandWithSort(FunctionScoreQueryBuilder  
149 - // functionScoreQueryBuilder) {  
150 - // String ruleValue =  
151 - // dynamicConfig.getIncreaseScoreBrandWithSortRuleValue();  
152 - // logger.debug("[func=incraseScoreForSpecificBrandWithSort][ruleValue={}]",  
153 - // ruleValue);  
154 - // if (StringUtils.isEmpty(ruleValue) || "-1".equals(ruleValue)) {  
155 - // return;  
156 - // }  
157 - // try {  
158 - // JSONObject jsonObject = JSON.parseObject(ruleValue);  
159 - // jsonObject.keySet().stream().filter(brandId ->  
160 - // StringUtils.isNotEmpty(jsonObject.getString(brandId))).forEach(brandId ->  
161 - // {  
162 - // BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();  
163 - // queryBuilder.must(QueryBuilders.termQuery(ProductIndexEsField.brandId,  
164 - // brandId));  
165 - // queryBuilder.must(QueryBuilders.termsQuery(ProductIndexEsField.smallSortId,  
166 - // ConvertUtils.stringToIntArray(jsonObject.getString(brandId), ",")));  
167 - // functionScoreQueryBuilder.add(queryBuilder,  
168 - // ScoreFunctionBuilders.weightFactorFunction(BRAND_SORT_INCREASE_SCORE_WEIGHT));  
169 - // });  
170 - // } catch (Exception e) {  
171 - // logger.warn("Parse score rule [" + ruleValue + "] failed!", e);  
172 - // }  
173 - // } 133 +
174 134
175 // 模糊搜索页的打分器 135 // 模糊搜索页的打分器
176 private List<IScorer> getFuzzyPageScorers(BoolQueryBuilder persionalFilter, Map<String, String> paramMap) { 136 private List<IScorer> getFuzzyPageScorers(BoolQueryBuilder persionalFilter, Map<String, String> paramMap) {
@@ -40,6 +40,9 @@ public class CommonSceneProductListService { @@ -40,6 +40,9 @@ public class CommonSceneProductListService {
40 } 40 }
41 41
42 private boolean isPersionalScene(Map<String, String> paramMap) { 42 private boolean isPersionalScene(Map<String, String> paramMap) {
  43 + if(!searchDynamicConfigService.openPersonalized()){
  44 + return false;
  45 + }
43 int uid = MapUtils.getIntValue(paramMap, "uid", 0); 46 int uid = MapUtils.getIntValue(paramMap, "uid", 0);
44 String order = MapUtils.getString(paramMap, "order", ""); 47 String order = MapUtils.getString(paramMap, "order", "");
45 if (uid > 0 && StringUtils.isEmpty(order)) { 48 if (uid > 0 && StringUtils.isEmpty(order)) {