title: Filter the aggregated results in sub aggregation using NEST
body: <p>I have the list of production and would like to get the sold count each product on two different time period. Able to generate the Elastic Search query as follows,</p>
  
  <pre><code>POST /Elastic/products/_search
  {
    "size": 0,
    "query": {
      "query_string": {
        "query": "(date:[20130501 TO 20140430])"
      }
    },
    "aggs": {
      "last12months": {
        "terms": {
          "field": "product",
          "order": {
            "last3months": "desc"
          },
          "exclude": "NA",
          "size": 20
        },
        "aggs": {
          "last3months": {
            "filter": {
              "range": {
                "date": {
                  "gte": "20140201",
                  "lte": "20140430"
                }
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>the result looks as follow,</p>
  
  <pre><code>"aggregations": {
        "last12months": {
           "doc_count_error_upper_bound": -1,
           "sum_other_doc_count": 938,
           "buckets": [
              {
                 "key": "xxxx",
                 "doc_count": 55,
                 "last3months": {
                    "doc_count": 41
                 }
              },
              {
                 "key": "yyyy",
                 "doc_count": 41,
                 "last3months": {
                    "doc_count": 14
                 }
              }
           ]
        }
     }
  </code></pre>
  
  <p>Since I am  using nest.net to generate the query from my application and able to generate the query but subaggregation part is little tricky here. Not able to apply the range inside filter on the sub aggregation.</p>
  
  <pre><code>ElasticSearchClient.Search&lt;Product&gt;(s =&gt; s.Size(0)
                  .Query(query =&gt; query
                      .Filtered(filtered =&gt; filtered
                          .Filter(filter =&gt; filter
                              .Range(range =&gt; range
                                  .OnField(ElasticFields.JobDate)
                                  .GreaterOrEquals("20140101")
                                  .LowerOrEquals("20141231"))
                          .Query(q =&gt; q
                              .QueryString(qs =&gt; qs.Query(queryString)))))
                  .Aggregations(aggregation =&gt; aggregation
                      .Terms("last12months", t1 =&gt; t1
  
                          .Field("product")
                          .OrderDescending("last3months")
                          .Size(25)
                          .Aggregations(innerAggregation =&gt; innerAggregation.Filter("last3months", t2 =&gt; t2.Filters(t3 =&gt; t3.Range(range =&gt; range.LowerOrEquals("").GreaterOrEquals("")))))
                          )));
  </code></pre>
  
  <p>how to achieve this?</p>
  
  <p>helps much appreciated</p>