...
|
...
|
@@ -96,6 +96,13 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
|
|
|
// 5、设置filter
|
|
|
BoolQueryBuilder boolFilter = searchLikeHelper.genDefaultQueryBuilder(Arrays.asList(productSkn));
|
|
|
// 1)设置此SKN相关的性别过滤条件
|
|
|
String gender = productInfoInEs.getString("gender");
|
|
|
List<String> genderList = searchLikeHelper.getGenderInfo(gender);
|
|
|
if (genderList != null) {
|
|
|
boolFilter.must(QueryBuilders.termsQuery("gender", genderList.toArray(new String[genderList.size()])));
|
|
|
}
|
|
|
// 2)设置品牌或店铺信息
|
|
|
Integer brandId = productInfoInEs.getInteger("brandId");
|
|
|
Integer shopId = productInfoInEs.getInteger("shopId");
|
|
|
if (isLegalInteger(shopId)) {
|
...
|
...
|
@@ -127,9 +134,9 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
if (searchResult != null) {
|
|
|
productList = searchServiceHelper.getProductMapList(searchResult.getResultList());
|
|
|
}
|
|
|
//低于4条不返回
|
|
|
if(productList==null || productList.size()<4){
|
|
|
productList = new ArrayList<Map<String,Object>>();
|
|
|
// 低于4条不返回
|
|
|
if (productList == null || productList.size() < 4) {
|
|
|
productList = new ArrayList<Map<String, Object>>();
|
|
|
}
|
|
|
jsonObject = new JSONObject();
|
|
|
jsonObject.put("page", 1);
|
...
|
...
|
|