Elastic search depreciated classes

It's unclear to me what you are getting in QueryBuilder andQuery or QueryBuilder andQueryBuilder.

Anyway, you can write something like:

client.search(new SearchRequest()
    .source(new SearchSourceBuilder().query(
            QueryBuilders.boolQuery()
                .filter(QueryBuilders.rangeQuery("location.lat").gte(0).lte(0))
                .filter(QueryBuilders.rangeQuery("location.lon").gte(0).lte(0))
    ))
);