Elasticsearch Java API has full-fledged implementation of Query DSL in a form of QueryBuilders and Query
Builder classes so writing (and maintaining) the complex queries is exceptionally easy
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html