Showing
1 changed file
with
33 additions
and
22 deletions
@@ -43,7 +43,7 @@ public class SearchServiceHelper { | @@ -43,7 +43,7 @@ public class SearchServiceHelper { | ||
43 | private DynamicSearchRuleHelper dynamicSearchRuleHelper; | 43 | private DynamicSearchRuleHelper dynamicSearchRuleHelper; |
44 | @Autowired | 44 | @Autowired |
45 | private FunctionScoreSearchHelper functionScoreSearchHelper; | 45 | private FunctionScoreSearchHelper functionScoreSearchHelper; |
46 | - | 46 | + |
47 | /** | 47 | /** |
48 | * 构造关键字查询的query | 48 | * 构造关键字查询的query |
49 | * | 49 | * |
@@ -97,7 +97,7 @@ public class SearchServiceHelper { | @@ -97,7 +97,7 @@ public class SearchServiceHelper { | ||
97 | 97 | ||
98 | return queryBuilder; | 98 | return queryBuilder; |
99 | } | 99 | } |
100 | - | 100 | + |
101 | /** | 101 | /** |
102 | * 构造关键字查询的query的时候operator默认为or,minimum匹配度是50% | 102 | * 构造关键字查询的query的时候operator默认为or,minimum匹配度是50% |
103 | * | 103 | * |
@@ -145,20 +145,25 @@ public class SearchServiceHelper { | @@ -145,20 +145,25 @@ public class SearchServiceHelper { | ||
145 | QueryBuilder queryBuilder = this.constructQueryBuilder(paramMap); | 145 | QueryBuilder queryBuilder = this.constructQueryBuilder(paramMap); |
146 | queryBuilder = functionScoreSearchHelper.buildFunctionScoreQueryBuild(queryBuilder, paramMap); | 146 | queryBuilder = functionScoreSearchHelper.buildFunctionScoreQueryBuild(queryBuilder, paramMap); |
147 | return queryBuilder; | 147 | return queryBuilder; |
148 | -// queryBuilder = this.buildPersonalSearch(queryBuilder, paramMap); | ||
149 | -// queryBuilder = this.buildFunctionScoreQueryBuild(queryBuilder, paramMap); | ||
150 | -// return queryBuilder; | ||
151 | - | ||
152 | - // String dynamicRuleValue = dynamicSearchRuleHelper.getDynamicRuleValue(paramMap); | ||
153 | -// if (StringUtils.isEmpty(dynamicRuleValue) || "-1".equals(dynamicRuleValue)) { | ||
154 | -// queryBuilder = this.buildGlobalSearch(queryBuilder, paramMap); | ||
155 | -// queryBuilder = this.buildDeScoreBrandSearch(queryBuilder, paramMap); | ||
156 | -// } else { | ||
157 | -// queryBuilder = dynamicSearchRuleHelper.buildDynamicSerach(queryBuilder, paramMap, dynamicRuleValue); | ||
158 | -// } | ||
159 | -// return queryBuilder; | 148 | + // queryBuilder = this.buildPersonalSearch(queryBuilder, paramMap); |
149 | + // queryBuilder = this.buildFunctionScoreQueryBuild(queryBuilder, | ||
150 | + // paramMap); | ||
151 | + // return queryBuilder; | ||
152 | + | ||
153 | + // String dynamicRuleValue = | ||
154 | + // dynamicSearchRuleHelper.getDynamicRuleValue(paramMap); | ||
155 | + // if (StringUtils.isEmpty(dynamicRuleValue) || | ||
156 | + // "-1".equals(dynamicRuleValue)) { | ||
157 | + // queryBuilder = this.buildGlobalSearch(queryBuilder, paramMap); | ||
158 | + // queryBuilder = this.buildDeScoreBrandSearch(queryBuilder, paramMap); | ||
159 | + // } else { | ||
160 | + // queryBuilder = | ||
161 | + // dynamicSearchRuleHelper.buildDynamicSerach(queryBuilder, paramMap, | ||
162 | + // dynamicRuleValue); | ||
163 | + // } | ||
164 | + // return queryBuilder; | ||
160 | } | 165 | } |
161 | - | 166 | + |
162 | public QueryBuilder constructOrQueryBuilderForProductList(Map<String, String> paramMap) { | 167 | public QueryBuilder constructOrQueryBuilderForProductList(Map<String, String> paramMap) { |
163 | QueryBuilder queryBuilder = this.constructOrQueryBuilder(paramMap); | 168 | QueryBuilder queryBuilder = this.constructOrQueryBuilder(paramMap); |
164 | queryBuilder = functionScoreSearchHelper.buildFunctionScoreQueryBuild(queryBuilder, paramMap); | 169 | queryBuilder = functionScoreSearchHelper.buildFunctionScoreQueryBuild(queryBuilder, paramMap); |
@@ -675,10 +680,7 @@ public class SearchServiceHelper { | @@ -675,10 +680,7 @@ public class SearchServiceHelper { | ||
675 | productMap.put("sales_num", map.get("salesNum")); | 680 | productMap.put("sales_num", map.get("salesNum")); |
676 | productMap.put("status", map.get("status")); | 681 | productMap.put("status", map.get("status")); |
677 | productMap.put("is_promotion", map.get("ispromotion")); | 682 | productMap.put("is_promotion", map.get("ispromotion")); |
678 | - productMap.put("is_promotion", map.get("ispromotion")); | ||
679 | - productMap.put("tbl_country_id", map.get("tblCountryId")); | ||
680 | - productMap.put("tbl_country_name", map.get("tblCountryName")); | ||
681 | - | 683 | + productMap.put("is_promotion", map.get("ispromotion")); |
682 | String yohoodIdFromMap = (String) map.get("yohoodId"); | 684 | String yohoodIdFromMap = (String) map.get("yohoodId"); |
683 | if (yohoodIdFromMap != null && yohoodIdFromMap.length() > 0) { | 685 | if (yohoodIdFromMap != null && yohoodIdFromMap.length() > 0) { |
684 | productMap.put("yohood_id", yohoodIdFromMap); | 686 | productMap.put("yohood_id", yohoodIdFromMap); |
@@ -695,13 +697,22 @@ public class SearchServiceHelper { | @@ -695,13 +697,22 @@ public class SearchServiceHelper { | ||
695 | productMap.put("student_price", map.get("studentPrice")); | 697 | productMap.put("student_price", map.get("studentPrice")); |
696 | } | 698 | } |
697 | productMap.put("country_id", map.get("countryId")); | 699 | productMap.put("country_id", map.get("countryId")); |
698 | - // 是否是全球购商品 | ||
699 | - productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal")); | ||
700 | // 是否学生返币 | 700 | // 是否学生返币 |
701 | productMap.put("is_student_rebate", map.get("isstudentrebate") == null ? "N" : map.get("isstudentrebate")); | 701 | productMap.put("is_student_rebate", map.get("isstudentrebate") == null ? "N" : map.get("isstudentrebate")); |
702 | // 年龄层,逗号隔开的字符串 | 702 | // 年龄层,逗号隔开的字符串 |
703 | productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel")); | 703 | productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel")); |
704 | - | 704 | + |
705 | + // 是否是全球购商品 | ||
706 | + productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal")); | ||
707 | + Integer tbl_country_id = 0; | ||
708 | + try { | ||
709 | + tbl_country_id = (Integer) map.get("tblCountryId"); | ||
710 | + } catch (Exception e) { | ||
711 | + } | ||
712 | + productMap.put("tbl_country_id", tbl_country_id); | ||
713 | + productMap.put("tbl_country_name", map.get("tblCountryName")); | ||
714 | + String tbl_plane = tbl_country_id == 86 ? "Y" : "N"; | ||
715 | + productMap.put("tbl_plane", tbl_plane); | ||
705 | return productMap; | 716 | return productMap; |
706 | } | 717 | } |
707 | } | 718 | } |
-
Please register or login to post a comment