模糊查询条件组合
String aaa= (String) param.get("aaa");
String bbb= (String) param.get("bbb");
if (UtilValidate.isEmpty(aaa)) {
aaa= "*";
} else {
aaa= "*" + aaa+ "*";
}
if (UtilValidate.isEmpty(bbb)) {
bbb= "*";
} else {
bbb= "*" + bbb+ "*";
}
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
.must(QueryBuilders.wildcardQuery("aaa" + ".keyword", aaa))
.must(QueryBuilders.wildcardQuery("bbb" + ".keyword", bbb))
;
order = entityDao.searcher(index, type, page, queryBuilder);
本博客中所有内容为本人自学及总结内容,
仅代表个人观点,如有错误,麻烦大家及时指出并提示我更正。谢谢