Showing
1 changed file
with
7 additions
and
7 deletions
@@ -82,7 +82,8 @@ public class GoodProductListService implements IGoodProductsService { | @@ -82,7 +82,8 @@ public class GoodProductListService implements IGoodProductsService { | ||
82 | List<Integer> smallSortIds = this.getProductSknSmallSortIds(paramMap, maxSmallSortCount); | 82 | List<Integer> smallSortIds = this.getProductSknSmallSortIds(paramMap, maxSmallSortCount); |
83 | // 3、再每个品类下获取5个SKN | 83 | // 3、再每个品类下获取5个SKN |
84 | List<String> recommondSkns = this.getRecommondedSkns(smallSortIds, maxProductSknCountPerSort, paramMap); | 84 | List<String> recommondSkns = this.getRecommondedSkns(smallSortIds, maxProductSknCountPerSort, paramMap); |
85 | - | 85 | + Collections.shuffle(recommondSkns); |
86 | + | ||
86 | // 4、构造搜索参数 | 87 | // 4、构造搜索参数 |
87 | SearchParam searchParam = new SearchParam(); | 88 | SearchParam searchParam = new SearchParam(); |
88 | searchParam.setFiter(this.getDefaultBoolQueryBuilder()); | 89 | searchParam.setFiter(this.getDefaultBoolQueryBuilder()); |
@@ -126,11 +127,11 @@ public class GoodProductListService implements IGoodProductsService { | @@ -126,11 +127,11 @@ public class GoodProductListService implements IGoodProductsService { | ||
126 | private QueryBuilder builderGoodProductQueryBuilder(Map<String, String> paramMap, List<String> recommendedSknList) { | 127 | private QueryBuilder builderGoodProductQueryBuilder(Map<String, String> paramMap, List<String> recommendedSknList) { |
127 | QueryBuilder queryBuilder = QueryBuilders.matchAllQuery(); | 128 | QueryBuilder queryBuilder = QueryBuilders.matchAllQuery(); |
128 | FunctionScoreQueryBuilder functionScoreQueryBuilder = new FunctionScoreQueryBuilder(queryBuilder); | 129 | FunctionScoreQueryBuilder functionScoreQueryBuilder = new FunctionScoreQueryBuilder(queryBuilder); |
129 | - // 针对参数里第一个SKN加分 | ||
130 | - String productSkns = paramMap.get(SearchRequestParams.PARAM_SYNC_SKN); | ||
131 | - if (!StringUtils.isBlank(productSkns)) { | ||
132 | - functionScoreQueryBuilder.add(QueryBuilders.termsQuery("productSkn", productSkns.split(",")[0]), ScoreFunctionBuilders.weightFactorFunction(firstSknScore)); | ||
133 | - } | 130 | +// // 针对参数里第一个SKN加分 |
131 | +// String productSkns = paramMap.get(SearchRequestParams.PARAM_SYNC_SKN); | ||
132 | +// if (!StringUtils.isBlank(productSkns)) { | ||
133 | +// functionScoreQueryBuilder.add(QueryBuilders.termsQuery("productSkn", productSkns.split(",")[0]), ScoreFunctionBuilders.weightFactorFunction(firstSknScore)); | ||
134 | +// } | ||
134 | // 针对推荐出来的SKN做加分 | 135 | // 针对推荐出来的SKN做加分 |
135 | if (recommendedSknList != null && !recommendedSknList.isEmpty()) { | 136 | if (recommendedSknList != null && !recommendedSknList.isEmpty()) { |
136 | Map<Integer, List<String>> recommondSknMap = this.splitProductSkns(recommendedSknList, maxCountPerGroup); | 137 | Map<Integer, List<String>> recommondSknMap = this.splitProductSkns(recommendedSknList, maxCountPerGroup); |
@@ -333,7 +334,6 @@ public class GoodProductListService implements IGoodProductsService { | @@ -333,7 +334,6 @@ public class GoodProductListService implements IGoodProductsService { | ||
333 | } | 334 | } |
334 | } | 335 | } |
335 | } | 336 | } |
336 | - Collections.shuffle(recommendedSknList); | ||
337 | return recommendedSknList; | 337 | return recommendedSknList; |
338 | } | 338 | } |
339 | 339 |
-
Please register or login to post a comment