|
@@ -11,6 +11,7 @@ import com.yoho.search.service.service.SearchCommonService; |
|
@@ -11,6 +11,7 @@ import com.yoho.search.service.service.SearchCommonService; |
11
|
import com.yoho.search.service.service.SearchDynamicConfigService;
|
11
|
import com.yoho.search.service.service.SearchDynamicConfigService;
|
12
|
import com.yoho.search.service.service.SearchKeyWordService;
|
12
|
import com.yoho.search.service.service.SearchKeyWordService;
|
13
|
import com.yoho.search.service.utils.SearchRequestParams;
|
13
|
import com.yoho.search.service.utils.SearchRequestParams;
|
|
|
14
|
+
|
14
|
import org.apache.commons.collections.CollectionUtils;
|
15
|
import org.apache.commons.collections.CollectionUtils;
|
15
|
import org.apache.commons.lang.StringUtils;
|
16
|
import org.apache.commons.lang.StringUtils;
|
16
|
import org.elasticsearch.index.query.*;
|
17
|
import org.elasticsearch.index.query.*;
|
|
@@ -337,8 +338,8 @@ public class SearchServiceHelper { |
|
@@ -337,8 +338,8 @@ public class SearchServiceHelper { |
337
|
}
|
338
|
}
|
338
|
// 促销标记
|
339
|
// 促销标记
|
339
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISPROMOTION) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION))) {
|
340
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISPROMOTION) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION))) {
|
340
|
- int[] ispromotions = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION),",");
|
|
|
341
|
- boolFilter.must(QueryBuilders.termsQuery("ispromotion",ispromotions));
|
341
|
+ int[] ispromotions = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION), ",");
|
|
|
342
|
+ boolFilter.must(QueryBuilders.termsQuery("ispromotion", ispromotions));
|
342
|
}
|
343
|
}
|
343
|
// vip折扣类型
|
344
|
// vip折扣类型
|
344
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE))) {
|
345
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE))) {
|
|
@@ -382,6 +383,17 @@ public class SearchServiceHelper { |
|
@@ -382,6 +383,17 @@ public class SearchServiceHelper { |
382
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISLIMITED) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED))) {
|
383
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISLIMITED) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED))) {
|
383
|
boolFilter.must(QueryBuilders.termQuery("islimited", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED)));
|
384
|
boolFilter.must(QueryBuilders.termQuery("islimited", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED)));
|
384
|
}
|
385
|
}
|
|
|
386
|
+ // 是否限购
|
|
|
387
|
+ if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY))) {
|
|
|
388
|
+ boolFilter.must(QueryBuilders.termQuery("isLimitbuy", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY)));
|
|
|
389
|
+ }
|
|
|
390
|
+ // 是否预售
|
|
|
391
|
+ if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISADVANCE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISADVANCE))) {
|
|
|
392
|
+ boolFilter.must(QueryBuilders.termQuery("isAdvance", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISADVANCE)));
|
|
|
393
|
+ }// 是否定金预售
|
|
|
394
|
+ if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE))) {
|
|
|
395
|
+ boolFilter.must(QueryBuilders.termQuery("isDepositAdvance", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE)));
|
|
|
396
|
+ }
|
385
|
// 是否新品
|
397
|
// 是否新品
|
386
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISNEW) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW))) {
|
398
|
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISNEW) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW))) {
|
387
|
boolFilter.must(QueryBuilders.termQuery("isnew", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW)));
|
399
|
boolFilter.must(QueryBuilders.termQuery("isnew", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW)));
|
|
@@ -673,7 +685,6 @@ public class SearchServiceHelper { |
|
@@ -673,7 +685,6 @@ public class SearchServiceHelper { |
673
|
productMap.put("small_sort_id", map.get("smallSortId"));
|
685
|
productMap.put("small_sort_id", map.get("smallSortId"));
|
674
|
productMap.put("max_sort_id", map.get("maxSortId"));
|
686
|
productMap.put("max_sort_id", map.get("maxSortId"));
|
675
|
productMap.put("is_discount", map.get("isDiscount"));
|
687
|
productMap.put("is_discount", map.get("isDiscount"));
|
676
|
- productMap.put("is_advance", map.get("isAdvance"));
|
|
|
677
|
productMap.put("is_soon_sold_out", map.get("isSoonSoldOut"));
|
688
|
productMap.put("is_soon_sold_out", map.get("isSoonSoldOut"));
|
678
|
productMap.put("edit_time", map.get("editTime"));
|
689
|
productMap.put("edit_time", map.get("editTime"));
|
679
|
productMap.put("shelve_time", map.get("shelveTime"));
|
690
|
productMap.put("shelve_time", map.get("shelveTime"));
|
|
@@ -702,7 +713,7 @@ public class SearchServiceHelper { |
|
@@ -702,7 +713,7 @@ public class SearchServiceHelper { |
702
|
productMap.put("is_student_rebate", map.get("isstudentrebate") == null ? "N" : map.get("isstudentrebate"));
|
713
|
productMap.put("is_student_rebate", map.get("isstudentrebate") == null ? "N" : map.get("isstudentrebate"));
|
703
|
// 年龄层,逗号隔开的字符串
|
714
|
// 年龄层,逗号隔开的字符串
|
704
|
productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel"));
|
715
|
productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel"));
|
705
|
-
|
716
|
+
|
706
|
// 是否是全球购商品
|
717
|
// 是否是全球购商品
|
707
|
productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal"));
|
718
|
productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal"));
|
708
|
Integer tbl_country_id = 0;
|
719
|
Integer tbl_country_id = 0;
|
|
@@ -712,7 +723,7 @@ public class SearchServiceHelper { |
|
@@ -712,7 +723,7 @@ public class SearchServiceHelper { |
712
|
}
|
723
|
}
|
713
|
productMap.put("tbl_country_id", tbl_country_id);
|
724
|
productMap.put("tbl_country_id", tbl_country_id);
|
714
|
productMap.put("tbl_country_name", map.get("tblCountryName"));
|
725
|
productMap.put("tbl_country_name", map.get("tblCountryName"));
|
715
|
- String tbl_plane = (tbl_country_id !=null && tbl_country_id!=86) ? "Y" : "N";
|
726
|
+ String tbl_plane = (tbl_country_id != null && tbl_country_id != 86) ? "Y" : "N";
|
716
|
productMap.put("tbl_plane", tbl_plane);
|
727
|
productMap.put("tbl_plane", tbl_plane);
|
717
|
return productMap;
|
728
|
return productMap;
|
718
|
}
|
729
|
}
|