es 查询满足条件1 或满足条件2 的结果合集
//主查询
matchQuery.must(
QueryBuilders.boolQuery()
.should(QueryBuilders.matchQuery("xm","好的"))//分词后匹配
.should(QueryBuilders.matchParaseQuery("addr","钱江路"))//匹配完整词
.should(QueryBuilders.termQuery("status",0))//完全匹配
.should(QueryBuilders.termsQuery("keyword",string[]))//多关键字匹配
);
SearchResponse response = client.prepareSearch("indexName")
.setFrom(0)
.setSize(10)
.setQuery(matchQuery)
.get();
SearchHits hits = response.getHits();
int count = (int) hits.getTotalHits();
for(SearchHit one:hits)
{
//遍历结果处理
}