title: Elastic Search Limiting the records that are aggregated
body: <p>I am running an elastic search query with aggregation, which I intend to limit to say 100 records. The problem is that even when I apply the "size" filter, there is no effect on the aggregation.</p>
  
  <pre><code>GET /index_name/index_type/_search
  {
    "size":0,
    "query":{
      "match_all": {}
    },
    "aggregations":{
      "courier_code" : {
        "terms" : {
          "field" : "city"
        }
    }
  }}
  </code></pre>
  
  <p>The result set is </p>
  
  <pre><code>{
    "took": 7,
    "timed_out": false,
    "_shards": {
      "total": 10,
      "successful": 10,
      "failed": 0
    },
    "hits": {
      "total": 10867,
      "max_score": 0,
      "hits": []
    },
    "aggregations": {
      "city": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
          {
            "key": "Mumbai",
            "doc_count": 2706
          },
          {
            "key": "London",
            "doc_count": 2700
          },
          {
            "key": "Patna",
            "doc_count": 1800
          },
          {
            "key": "New York",
            "doc_count": 1800
          },
          {
            "key": "Melbourne",
            "doc_count": 900
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>As you can see there is no effect on limiting the records on which the aggregation is to be performed. Is there a filter for, say top 100 records in Elastic Search.</p>