编程语言
首页 > 编程语言> > es java 多条件查询

es java 多条件查询

作者:互联网

形如mysql中where条件 a=8 and (b=3 or b=4)

BoolQueryBuilder builder = QueryBuilders.boolQuery()

.must(QueryBuilders.termQuery(a,8))
.must(QueryBuilders.boolQuery()
.should(QueryBuilders.termQuery(b,3))
.should(QueryBuilders.termQuery(b,4)));

标签:BoolQueryBuilder,java,boolQuery,查询,termQuery,should,QueryBuilders,es,must
来源: https://www.cnblogs.com/zxy-come-on/p/15200760.html