title: elasticsearch sub-aggregations failing
body: <p>On ES 2.2 I am trying the following query:</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "must": {
          "match_all": {}
        },
        "filter": {
          "range": {
            "startDate": {
              "gt": "2016-07-01"
            }
          }
        }
      }
    },
    "aggs": {
      "numbera": {
        "terms": {
          "field": "numbera",
          "size": 0,
          "aggs": {
            "some": {
              "avg": {
                "field": "callDuration"
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>which gives the following error:</p>
  
  <pre><code>{
      "type": "search_parse_exception",
      "reason": "Unknown key for a START_OBJECT in [numbera]: [aggs].",
      "line": 20,
      "col": 18
  }
  </code></pre>
  
  <p>I am at a loss, what is wrong with that query?</p>
  
  <p>Removing the sub aggregation from the query gives me a proper result.    </p>