|
|
package com.yoho.search.recall.scene.models;
|
|
|
|
|
|
import com.yoho.search.base.utils.MD5Util;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilder;
|
|
|
|
|
|
public class ParamQueryFilter {
|
|
|
|
|
|
private QueryBuilder paramQuery;
|
|
|
private BoolQueryBuilder paramFilter;
|
|
|
private String paramMd5Key;
|
|
|
|
|
|
private String getMd5Key(){
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
sb.append("paramQuery:").append(paramQuery==null?"":paramQuery.toString());
|
|
|
sb.append("paramFilter:").append(paramFilter==null?"":paramFilter.toString());
|
|
|
return MD5Util.string2MD5(sb.toString());
|
|
|
}
|
|
|
|
|
|
public ParamQueryFilter(QueryBuilder paramQuery, BoolQueryBuilder paramFilter){
|
|
|
this.paramQuery = paramQuery;
|
|
|
this.paramFilter = paramFilter;
|
|
|
this.paramMd5Key = this.getMd5Key();
|
|
|
}
|
|
|
|
|
|
public QueryBuilder getParamQuery() {
|
|
|
return paramQuery;
|
|
|
}
|
|
|
|
|
|
public BoolQueryBuilder getParamFilter() {
|
|
|
return paramFilter;
|
|
|
}
|
|
|
|
|
|
public String getParamMd5Key() {
|
|
|
return paramMd5Key;
|
|
|
}
|
|
|
} |
|
|
package com.yoho.search.recall.scene.models;
|
|
|
|
|
|
import com.yoho.search.base.utils.MD5Util;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilder;
|
|
|
|
|
|
public class ParamQueryFilter {
|
|
|
|
|
|
private QueryBuilder paramQuery;
|
|
|
private BoolQueryBuilder paramFilter;
|
|
|
private String paramMd5Key;
|
|
|
|
|
|
private String getMd5Key(){
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
sb.append("paramQuery:").append(paramQuery==null?"":paramQuery.toString());
|
|
|
sb.append("paramFilter:").append(paramFilter==null?"":paramFilter.toString());
|
|
|
return MD5Util.string2MD5(sb.toString());
|
|
|
}
|
|
|
|
|
|
public ParamQueryFilter(QueryBuilder paramQuery, BoolQueryBuilder paramFilter){
|
|
|
this.paramQuery = paramQuery;
|
|
|
this.paramFilter = paramFilter;
|
|
|
this.paramMd5Key = this.getMd5Key();
|
|
|
}
|
|
|
|
|
|
public QueryBuilder getParamQuery() {
|
|
|
return paramQuery;
|
|
|
}
|
|
|
|
|
|
public BoolQueryBuilder getParamFilter() {
|
|
|
return paramFilter;
|
|
|
}
|
|
|
|
|
|
public String getParamMd5Key() {
|
|
|
return paramMd5Key;
|
|
|
}
|
|
|
} |
...
|
...
|
|