...
|
...
|
@@ -138,8 +138,8 @@ public class SearchServiceHelper { |
|
|
}
|
|
|
|
|
|
private boolean isNeedDeScoreBrandSearch(Map<String, String> paramMap) {
|
|
|
//如果品牌降分总开关未开启,则直接返回
|
|
|
if(!dynamicConfig.deScoreBrandOpen()){
|
|
|
// 如果品牌降分总开关未开启,则直接返回
|
|
|
if (!dynamicConfig.deScoreBrandOpen()) {
|
|
|
return false;
|
|
|
}
|
|
|
// 如果是按售价或者折扣排序或品牌也或店铺页,则降分不生效
|
...
|
...
|
@@ -294,13 +294,13 @@ public class SearchServiceHelper { |
|
|
if (StringUtils.isBlank(keyword)) {
|
|
|
return QueryBuilders.matchAllQuery();
|
|
|
}
|
|
|
//0、处理is_encode的情况,编码转换
|
|
|
// 0、处理is_encode的情况,编码转换
|
|
|
String is_encode = paramMap.get("is_encode");
|
|
|
if(StringUtils.isNotBlank(is_encode)&&is_encode.equals("1")){
|
|
|
if (StringUtils.isNotBlank(is_encode) && is_encode.equals("1")) {
|
|
|
try {
|
|
|
keyword = URLDecoder.decode(keyword, "UTF-8");
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
logger.warn(e.getMessage(),e);
|
|
|
logger.warn(e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
paramMap.put("query", keyword);
|
...
|
...
|
@@ -372,15 +372,12 @@ public class SearchServiceHelper { |
|
|
queryBuilder = this.buildPersonalSearch(queryBuilder, paramMap);
|
|
|
|
|
|
String dynamicRuleValue = dynamicSearchRuleHelper.getDynamicRuleValue(paramMap);
|
|
|
if(StringUtils.isEmpty(dynamicRuleValue) || "-1".equals(dynamicRuleValue))
|
|
|
{
|
|
|
if (StringUtils.isEmpty(dynamicRuleValue) || "-1".equals(dynamicRuleValue)) {
|
|
|
queryBuilder = this.buildDeScoreBrandSearch(queryBuilder, paramMap);
|
|
|
queryBuilder = this.buildGlobalSearch(queryBuilder, paramMap);
|
|
|
}
|
|
|
else {
|
|
|
} else {
|
|
|
queryBuilder = dynamicSearchRuleHelper.buildDynamicSerach(queryBuilder, paramMap, dynamicRuleValue);
|
|
|
}
|
|
|
|
|
|
return queryBuilder;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -513,7 +510,7 @@ public class SearchServiceHelper { |
|
|
*/
|
|
|
public void setDefaultSearchField(MultiMatchQueryBuilder queryBuilder, Map<String, String> paramMap) {
|
|
|
List<String> fields = dynamicSearchRuleHelper.getDynamicSearchFields(paramMap);
|
|
|
if(CollectionUtils.isEmpty(fields)){
|
|
|
if (CollectionUtils.isEmpty(fields)) {
|
|
|
fields = ISearchConstants.SEARCH_DEFAULT_FIELD;
|
|
|
}
|
|
|
|
...
|
...
|
|