Authored by wangnan

helper fix

... ... @@ -84,12 +84,11 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap
MultiMatchQueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(keyword);
queryBuilder.type(MultiMatchQueryBuilder.Type.CROSS_FIELDS);
queryBuilder.operator(MatchQueryBuilder.Operator.OR);
// if (paramMap.containsKey(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE))) {
// queryBuilder.minimumShouldMatch("50%");
// }else{
// queryBuilder.minimumShouldMatch("30%");
// }
queryBuilder.minimumShouldMatch("50%");
if (paramMap.containsKey("showCustomerService") && StringUtils.isNotBlank(paramMap.get("showCustomerService")) && paramMap.get("showCustomerService").equals("Y")) {
queryBuilder.minimumShouldMatch("30%");
} else {
queryBuilder.minimumShouldMatch("50%");
}
queryBuilder.field("caption", 200).field("keywords", 100);
// 4.配置Filter
... ... @@ -142,7 +141,10 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap
*/
private BoolQueryBuilder constructHelperFilterBuilder(Map<String, String> paramMap) throws Exception {
BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
//boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE);
if (!paramMap.containsKey("showCustomerService") || !StringUtils.isNotBlank(paramMap.get("showCustomerService")) || !paramMap.get("showCustomerService").equals("Y")) {
boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE, "N"));
}
boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE);
boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_ISCUSTOMERSERVICE, "N"));
boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_STATUS, 1));
boolFilter = boolQueryTermQuery(paramMap, boolFilter, SearchRequestParams.HELPER_PARAM_FIRSTCATEGORYID);
... ...