...
|
...
|
@@ -85,31 +85,32 @@ public class ExtendFilterHelper { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 不能加任何额外条件
|
|
|
* 页面的人气兜底策略
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder commonCtrValueFilter() {
|
|
|
public static QueryBuilder commonHeatValueFilter() {
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
filter.must(QueryBuilders.rangeQuery(ProductIndexEsField.ctrValue).gt(0));
|
|
|
filter.must(QueryBuilders.rangeQuery(ProductIndexEsField.heatValue).gt(0));
|
|
|
//must not
|
|
|
filter.mustNot(notRecallFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 不能加任何额外条件
|
|
|
* 页面的点击率兜底策略
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public static QueryBuilder commonHeatValueFilter() {
|
|
|
public static QueryBuilder commonCtrValueFilter() {
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
filter.must(QueryBuilders.rangeQuery(ProductIndexEsField.heatValue).gt(0));
|
|
|
filter.must(QueryBuilders.rangeQuery(ProductIndexEsField.ctrValue).gt(0));
|
|
|
//must not
|
|
|
filter.mustNot(notRecallFilter());
|
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 【品类+品牌】人气-【除去新品,新降价和新开促销】
|
|
|
*
|
...
|
...
|
@@ -237,19 +238,15 @@ public class ExtendFilterHelper { |
|
|
return filter;
|
|
|
}
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
BoolQueryBuilder filter = QueryBuilders.boolQuery();
|
|
|
// filter.mustNot(QueryBuilders.termQuery(ProductIndexEsField.flowType, "2"));
|
|
|
// filter.mustNot(QueryBuilders.termQuery(ProductIndexEsField.isGlobal, "Y"));
|
|
|
// filter.mustNot(QueryBuilders.rangeQuery(ProductIndexEsField.breakSizePercent).gt(50));
|
|
|
|
|
|
filter.mustNot(notRecallFilter());
|
|
|
SearchParam searchParam = new SearchParam();
|
|
|
searchParam.setFiter(filter);
|
|
|
System.out.println(SearchParamUtils.genSearchSourceBuilderFromSearchParam(searchParam).toString());
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|