title: How to add average or sum buckets to terms aggregation?
body: <p>I made query with two terms aggregation, and also I tried to each of them a new aggregation for average or sum. For example: I want to search average of &quot;agg1&quot;, and sum of &quot;agg2&quot;. Is it possible to make it separately?
  Here is my query:</p>
  <pre><code>{
    &quot;aggs&quot;: {
      &quot;agg1&quot;: {
        &quot;terms&quot;: {
          &quot;field&quot;: &quot;destination.bytes&quot;
        },
        &quot;aggs&quot;: {
          &quot;agg2&quot;: {
            &quot;terms&quot;: {
              &quot;field&quot;: &quot;source.bytes&quot;
            }
          }
        }
      }
    }
  }
  </code></pre>