https://meilishiyan-song.taobao.com/

模糊查询条件组合

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);

posted @ 2017-05-10 10:48  望梦圆  阅读(319)  评论(0编辑  收藏  举报
https://meilishiyan-song.taobao.com/