Authored by 胡古飞

品类列表支持一个SKN排在前面

@@ -58,7 +58,12 @@ public class FunctionScoreSearchHelper { @@ -58,7 +58,12 @@ public class FunctionScoreSearchHelper {
58 // 将某些SKN展示到前面 58 // 将某些SKN展示到前面
59 if (searchCommonHelper.isFirstProductSknSearch(paramMap)) { 59 if (searchCommonHelper.isFirstProductSknSearch(paramMap)) {
60 String[] productSkns = paramMap.get(SearchRequestParams.PARAM_SEARCH_FIRST_PRODUCRSKN).split(","); 60 String[] productSkns = paramMap.get(SearchRequestParams.PARAM_SEARCH_FIRST_PRODUCRSKN).split(",");
61 - functionScoreQueryBuilder.add(QueryBuilders.termsQuery(ProductIndexEsField.productSkn, productSkns), ScoreFunctionBuilders.weightFactorFunction(1000)); 61 + //品类列表支持1个排前面
  62 + if(searchCommonHelper.isSortPageDefault(paramMap)){
  63 + functionScoreQueryBuilder.add(QueryBuilders.termQuery(ProductIndexEsField.productSkn, productSkns[0]), ScoreFunctionBuilders.weightFactorFunction(1000));
  64 + }else{
  65 + functionScoreQueryBuilder.add(QueryBuilders.termsQuery(ProductIndexEsField.productSkn, productSkns), ScoreFunctionBuilders.weightFactorFunction(1000));
  66 + }
62 } 67 }
63 // 个性化搜索相关 68 // 个性化搜索相关
64 if (searchCommonHelper.isNeedPersonalSearch(paramMap)) { 69 if (searchCommonHelper.isNeedPersonalSearch(paramMap)) {