我正在尝试使用和条件获取记录,但是弹性搜索将最后投放的源设置为最终条件
rangeSourceBuilder.query(QueryBuilders.rangeQuery("timestamp").lte(dataequest.getStart())
.gte(data.getEnd()).includeLower(true).includeUpper(false));
SearchSourceBuilder commonTermsQueryBuilder = new SearchSourceBuilder();
commonTermsQueryBuilder.query(QueryBuilders.commonTermsQuery("timeInterval",cadata.getTimeInterval()));
**searchRequest.source(rangeSourceBuilder).source(commonTermsQueryBuilder);**
如何在searchRequest中添加2个源。 我尝试了boolQuery,但仍然无法正常工作