...
|
...
|
@@ -61,75 +61,6 @@ public class ExtendFilterHelper { |
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌新品
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder brandNewFilter (List<Integer> brandIds){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
//must
|
|
|
filter.must(brandIdsFilter(brandIds));
|
|
|
filter.must(newFilter());
|
|
|
//must not
|
|
|
filter.mustNot(forbiddenFlowFilter());
|
|
|
filter.mustNot(latestReducePriceFilter());
|
|
|
filter.mustNot(isGlobalFilter());
|
|
|
filter.mustNot(breakSizeFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌新降价
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder brandReducePrice (List<Integer> brandIds){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
//must
|
|
|
filter.must(brandIdsFilter(brandIds));
|
|
|
filter.must(latestReducePriceFilter());
|
|
|
//must not
|
|
|
filter.mustNot(forbiddenFlowFilter());
|
|
|
filter.mustNot(newFilter());
|
|
|
filter.mustNot(isGlobalFilter());
|
|
|
filter.mustNot(breakSizeFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌人气
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder brandHeatValue (List<Integer> brandIds){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
//must
|
|
|
filter.must(brandIdsFilter(brandIds));
|
|
|
//must not
|
|
|
filter.mustNot(forbiddenFlowFilter());
|
|
|
filter.mustNot(newFilter());
|
|
|
filter.mustNot(latestReducePriceFilter());
|
|
|
filter.mustNot(isGlobalFilter());
|
|
|
filter.mustNot(breakSizeFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌新开促销
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder brandPromotion (List<Integer> brandIds){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
//must
|
|
|
filter.must(brandIdsFilter(brandIds));
|
|
|
filter.must(isNewPromotionFilter());
|
|
|
//must not
|
|
|
filter.mustNot(forbiddenFlowFilter());
|
|
|
filter.mustNot(newFilter());
|
|
|
filter.mustNot(latestReducePriceFilter());
|
|
|
filter.mustNot(isGlobalFilter());
|
|
|
filter.mustNot(breakSizeFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 【品类+品牌】新品
|
...
|
...
|
@@ -216,14 +147,6 @@ public class ExtendFilterHelper { |
|
|
return QueryBuilders.rangeQuery(ProductIndexEsField.breakSizePercent).gt(50);
|
|
|
}
|
|
|
|
|
|
private static QueryBuilder brandIdsFilter (List<Integer> brandIds){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
if (brandIds != null && !brandIds.isEmpty()) {
|
|
|
filter.must(QueryBuilders.termsQuery(ProductIndexEsField.brandId, brandIds));
|
|
|
}
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
private static QueryBuilder sortBrandIdFilter (SortBrand sortBrand){
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
filter.must(QueryBuilders.termQuery(ProductIndexEsField.brandId, sortBrand.getBrandId()));
|
...
|
...
|
|