title: elasticsearch, stats aggregation on multiple fields JAVA API
body: <p>I have the following aggregation query that I tested and run fine. I am wondering how to build the equivalent query using its JAVA API. In fact I have a <code>List&lt;String&gt;</code> of each element I'd like to see the stats. How can I do this dynamically? </p>
  
  <p>Thank you in advance.</p>
  
  <pre><code>{
    "from" : 0,
    "size" : 0,
    "aggs": {
      "value_stats" :{
        "stats": {
          "field" : "value"
        }
      },
      "qty_stats":{
        "stats": {"field" : "qty"}
      }
    }
  }
  </code></pre>