title: Accessing results of max aggregation in elasticsearch
body: <p>I am doing a max aggregation on a numeric field in elasticsearch as follows:</p>
  
  <pre><code>SearchResponse sr = client
                  .prepareSearch("test")
                  .setTypes("test")
                  .setQuery(QueryBuilders.matchAllQuery())
                  .addAggregation(
                          AggregationBuilders.max("id").field(
                                  "id")).execute().actionGet();
  </code></pre>
  
  <p>How do I access the max.value returned in java? I could see an example only for terms aggregation. Please help me with this. Thanks.</p>