Merge branch 'master' into good_goods
Showing
3 changed files
with
14 additions
and
3 deletions
@@ -45,10 +45,10 @@ public class FunctionScoreSearchHelper { | @@ -45,10 +45,10 @@ public class FunctionScoreSearchHelper { | ||
45 | 45 | ||
46 | public QueryBuilder buildFunctionScoreQueryBuild(QueryBuilder queryBuilder, Map<String, String> paramMap) { | 46 | public QueryBuilder buildFunctionScoreQueryBuild(QueryBuilder queryBuilder, Map<String, String> paramMap) { |
47 | FunctionScoreQueryBuilder functionScoreQueryBuilder = new FunctionScoreQueryBuilder(queryBuilder); | 47 | FunctionScoreQueryBuilder functionScoreQueryBuilder = new FunctionScoreQueryBuilder(queryBuilder); |
48 | - // 将某个SKN展示到第一个 | 48 | + // 将某些SKN展示到前面 |
49 | if (searchCommonHelper.isFirstProductSknSearch(paramMap)) { | 49 | if (searchCommonHelper.isFirstProductSknSearch(paramMap)) { |
50 | - functionScoreQueryBuilder.add(QueryBuilders.termQuery("productSkn", paramMap.get(SearchRequestParams.FIRST_PRODUCRSKN)), | ||
51 | - ScoreFunctionBuilders.weightFactorFunction(1000)); | 50 | + String[] productSkns = paramMap.get(SearchRequestParams.FIRST_PRODUCRSKN).split(","); |
51 | + functionScoreQueryBuilder.add(QueryBuilders.termsQuery("productSkn",productSkns),ScoreFunctionBuilders.weightFactorFunction(1000)); | ||
52 | } | 52 | } |
53 | if (searchCommonHelper.isNeedPersonalSearch(paramMap)) { | 53 | if (searchCommonHelper.isNeedPersonalSearch(paramMap)) { |
54 | personalVectorFeatureSearch.addPersonalizedScriptScore(functionScoreQueryBuilder, paramMap); | 54 | personalVectorFeatureSearch.addPersonalizedScriptScore(functionScoreQueryBuilder, paramMap); |
@@ -265,6 +265,15 @@ public class SearchServiceHelper { | @@ -265,6 +265,15 @@ public class SearchServiceHelper { | ||
265 | int[] smallsortids = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_SMALLSORT), ","); | 265 | int[] smallsortids = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_SMALLSORT), ","); |
266 | boolFilter.must(QueryBuilders.termsQuery("smallSortId", smallsortids)); | 266 | boolFilter.must(QueryBuilders.termsQuery("smallSortId", smallsortids)); |
267 | } | 267 | } |
268 | + // 大中小分类 | ||
269 | + if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_COMMONSORT) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_COMMONSORT))) { | ||
270 | + int[] commonSortIds = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_COMMONSORT), ","); | ||
271 | + BoolQueryBuilder commonSortIdFilter = QueryBuilders.boolQuery(); | ||
272 | + commonSortIdFilter.should(QueryBuilders.termsQuery("maxSortId", commonSortIds)); | ||
273 | + commonSortIdFilter.should(QueryBuilders.termsQuery("middleSortId", commonSortIds)); | ||
274 | + commonSortIdFilter.should(QueryBuilders.termsQuery("smallSortId", commonSortIds)); | ||
275 | + boolFilter.must(commonSortIdFilter); | ||
276 | + } | ||
268 | // 颜色 | 277 | // 颜色 |
269 | if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_COLOR) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_COLOR)) | 278 | if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_COLOR) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_COLOR)) |
270 | && !SearchRequestParams.PARAM_SEARCH_COLOR.equals(filterParamName)) { | 279 | && !SearchRequestParams.PARAM_SEARCH_COLOR.equals(filterParamName)) { |
@@ -6,6 +6,8 @@ public class SearchRequestParams { | @@ -6,6 +6,8 @@ public class SearchRequestParams { | ||
6 | public static final String PARAM_SEARCH_MAXSORT = "msort"; // 查询大类 | 6 | public static final String PARAM_SEARCH_MAXSORT = "msort"; // 查询大类 |
7 | public static final String PARAM_SEARCH_MIDDLESORT = "misort"; // 查询中类 | 7 | public static final String PARAM_SEARCH_MIDDLESORT = "misort"; // 查询中类 |
8 | public static final String PARAM_SEARCH_SMALLSORT = "sort"; // 查询小类 | 8 | public static final String PARAM_SEARCH_SMALLSORT = "sort"; // 查询小类 |
9 | + public static final String PARAM_SEARCH_COMMONSORT = "common_sort";//不区分大中小分类的品类id | ||
10 | + | ||
9 | public static final String PARAM_SEARCH_GENDER = "gender"; // 查询男女款 | 11 | public static final String PARAM_SEARCH_GENDER = "gender"; // 查询男女款 |
10 | public static final String PARAM_SEARCH_AGELEVEL = "ageLevel"; // 查询年龄段 | 12 | public static final String PARAM_SEARCH_AGELEVEL = "ageLevel"; // 查询年龄段 |
11 | public static final String PARAM_SEARCH_APPTYPE = "app_type"; // APP类型 | 13 | public static final String PARAM_SEARCH_APPTYPE = "app_type"; // APP类型 |
-
Please register or login to post a comment