I have a simple SearchRequest using the new elasticsearch Java API Client Library.
return SearchRequest.of(sr -> sr
.index("myIndex")
.query(q -> q
.bool(b -> b
.must(myCustomBoolQuery1)
.must(myCustomRangeQuery1)
.must(myCustomMatchQuery1)
)
)
How can I prevent adding myCustomRangeQuery1 if it is null?