List queries = new ArrayList<>();
I want to pass all the queries to build a query with several must clauses. Is it possible to pass the queries like this
queryBuilder = QueryBuilders.boolQuery().must(queries);
The BoolQueryBuilder#must() method only accepts a single query, but you can chain them together, wither manually like boolQueryBuilder.must(query1).must(query2)... or add all your queries in a loop.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.