title: how to get above average from Elasticsearch?
body: <p>I have a question about QueryDSL in Elasticsearch.
  This is a test query.</p>
  
  <pre><code>GET index/_search {
      "size": 0,
      "aggs": {
          "groupByClass": {
              "terms": {
                  "field": "group"
              },
              "aggs": {
                  "avgGroup": {
                      "avg": {
                          "field": "score"
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I want to get values greater than avgGroup such as </p>
  
  <pre><code>SELECT * 
  FROM index
  WHERE score &gt; (SELECT AVG(score) FROM index)
  </code></pre>