Hello.
We are upgrading our elastic java client from 6.8.10 to 8.1.3 and it seems BoolQuery.Builder doesn't have hasClauses() method anymore. Is there any workaround which provides the same functionality?
Thanks in advance.
Hello.
We are upgrading our elastic java client from 6.8.10 to 8.1.3 and it seems BoolQuery.Builder doesn't have hasClauses() method anymore. Is there any workaround which provides the same functionality?
Thanks in advance.
The builders only have setters. A workaround (assuming you have a BoolQuery bq
object) is bool hasClauses = !bq.must().isEmpty() && !bq.mustNot().isEmpty() && !bq.should().isEmpty()
Thanks for your response, I was considering to go with the same approach.
In my opinion it'd have been great if we still had the built-in hasClauses()
method not in the builder but in BoolQuery
class
This is indeed a good suggestion!
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.