Authored by hugufei

fix

1 -package com.yoho.search.recall.scene.models;  
2 -  
3 -import com.yoho.search.base.utils.MD5Util;  
4 -import org.elasticsearch.index.query.BoolQueryBuilder;  
5 -import org.elasticsearch.index.query.QueryBuilder;  
6 -  
7 -public class ParamQueryFilter {  
8 -  
9 - private QueryBuilder paramQuery;  
10 - private BoolQueryBuilder paramFilter;  
11 - private String paramMd5Key;  
12 -  
13 - private String getMd5Key(){  
14 - StringBuilder sb = new StringBuilder();  
15 - sb.append("paramQuery:").append(paramQuery==null?"":paramQuery.toString());  
16 - sb.append("paramFilter:").append(paramFilter==null?"":paramFilter.toString());  
17 - return MD5Util.string2MD5(sb.toString());  
18 - }  
19 -  
20 - public ParamQueryFilter(QueryBuilder paramQuery, BoolQueryBuilder paramFilter){  
21 - this.paramQuery = paramQuery;  
22 - this.paramFilter = paramFilter;  
23 - this.paramMd5Key = this.getMd5Key();  
24 - }  
25 -  
26 - public QueryBuilder getParamQuery() {  
27 - return paramQuery;  
28 - }  
29 -  
30 - public BoolQueryBuilder getParamFilter() {  
31 - return paramFilter;  
32 - }  
33 -  
34 - public String getParamMd5Key() {  
35 - return paramMd5Key;  
36 - }  
37 -} 1 +package com.yoho.search.recall.scene.models;
  2 +
  3 +import com.yoho.search.base.utils.MD5Util;
  4 +import org.elasticsearch.index.query.BoolQueryBuilder;
  5 +import org.elasticsearch.index.query.QueryBuilder;
  6 +
  7 +public class ParamQueryFilter {
  8 +
  9 + private QueryBuilder paramQuery;
  10 + private BoolQueryBuilder paramFilter;
  11 + private String paramMd5Key;
  12 +
  13 + private String getMd5Key(){
  14 + StringBuilder sb = new StringBuilder();
  15 + sb.append("paramQuery:").append(paramQuery==null?"":paramQuery.toString());
  16 + sb.append("paramFilter:").append(paramFilter==null?"":paramFilter.toString());
  17 + return MD5Util.string2MD5(sb.toString());
  18 + }
  19 +
  20 + public ParamQueryFilter(QueryBuilder paramQuery, BoolQueryBuilder paramFilter){
  21 + this.paramQuery = paramQuery;
  22 + this.paramFilter = paramFilter;
  23 + this.paramMd5Key = this.getMd5Key();
  24 + }
  25 +
  26 + public QueryBuilder getParamQuery() {
  27 + return paramQuery;
  28 + }
  29 +
  30 + public BoolQueryBuilder getParamFilter() {
  31 + return paramFilter;
  32 + }
  33 +
  34 + public String getParamMd5Key() {
  35 + return paramMd5Key;
  36 + }
  37 +}