'Nesting boolQueryBuilder in elasticSearch v5.6 in RestHighLevel client(JAVA)

I use boolQueryBuilder for evaluating queries like (name:xxx OR grade:y) but I need to evaluate queries like (name:[x AND z] OR grade:y), I need to use java's restHighLevel client to do this.

In order to do this I need to nest boolQueryBuilder, can anyone help with that? Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source