Authored by wangnan

helper回退

@@ -84,11 +84,12 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap @@ -84,11 +84,12 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap
84 MultiMatchQueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(keyword); 84 MultiMatchQueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(keyword);
85 queryBuilder.type(MultiMatchQueryBuilder.Type.CROSS_FIELDS); 85 queryBuilder.type(MultiMatchQueryBuilder.Type.CROSS_FIELDS);
86 queryBuilder.operator(MatchQueryBuilder.Operator.OR); 86 queryBuilder.operator(MatchQueryBuilder.Operator.OR);
87 - if (paramMap.containsKey(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE))) {  
88 - queryBuilder.minimumShouldMatch("50%");  
89 - }else{  
90 - queryBuilder.minimumShouldMatch("30%");  
91 - } 87 +// if (paramMap.containsKey(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE))) {
  88 +// queryBuilder.minimumShouldMatch("50%");
  89 +// }else{
  90 +// queryBuilder.minimumShouldMatch("30%");
  91 +// }
  92 + queryBuilder.minimumShouldMatch("50%");
92 queryBuilder.field("caption", 200).field("keywords", 100); 93 queryBuilder.field("caption", 200).field("keywords", 100);
93 94
94 // 4.配置Filter 95 // 4.配置Filter
@@ -141,7 +142,8 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap @@ -141,7 +142,8 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap
141 */ 142 */
142 private BoolQueryBuilder constructHelperFilterBuilder(Map<String, String> paramMap) throws Exception { 143 private BoolQueryBuilder constructHelperFilterBuilder(Map<String, String> paramMap) throws Exception {
143 BoolQueryBuilder boolFilter = QueryBuilders.boolQuery(); 144 BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
144 - boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE); 145 + //boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE);
  146 + boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE, "N"));
145 boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_STATUS, 1)); 147 boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_STATUS, 1));
146 boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_FIRSTCATEGORYID); 148 boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_FIRSTCATEGORYID);
147 boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_SECENDCATEGORYID); 149 boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_SECENDCATEGORYID);