title: elasticsearch filter don't work with aggregation
body: <p>I am working with elasticsearch and create the following mapping, creating geo index, long field to compare it (gte) ,and boolean filed to identify gender.</p>
  
  <pre><code>curl -XDELETE 'http://localhost:9165/locations' &amp;&amp; echo
  curl -XPUT 'http://localhost:9165/locations' &amp;&amp; echo
  curl -XPUT 'http://localhost:9165/locations/location/_mapping' -d '
  {
      "location": {
          "properties": {
              "location": {"type" : "geo_point"},
              "gender" : {"type" : "boolean"},
              "last_appearance": {"type": "long"}
          }
      }
  }'  &amp;&amp; echo "Mapping done"
  </code></pre>
  
  <p>then I am doing the following insertion to index:</p>
  
  <pre><code>curl -XPUT 'http://localhost:9165/locations/location/1' -d '{
     "location":
     {
      "lat": "47.785346",
      "lon": "67.701857"
     },
      "category_id": "5",
      "gender": "true",
      "city": "Almaty",
      "last_appearance": "3333333",
      "venue_id": "5229774711d2a3ec9e333d00"
  }'
  </code></pre>
  
  <p>finally I try to filter all data where last appearance of user is bigger then some test value, in my case it will be 222222222222222222 and city is Almaty, then I want to do some aggregation with filtered data.</p>
  
  <pre><code>curl -X GET http://localhost:9165/locations/location/_search -d '
  {
      "filter" : {
        "and" : [
          {
            "range" :
            {
              "last_appearance" :
              {
                  "gte" : "222222222222222222"
                }
            }
          },
          {
              "term" : {"city" : "Almaty"}
          }
        ]
      },
  
      "aggs" : {
          "venues" : {
              "terms" : { "field" : "venue_id"},
              "aggs": {
                  "genders" : {
                      "terms" : {"field" : "gender"}
                  }
              }
          }
      }
  }' | python -mjson.tool
  </code></pre>
  
  <p>I don't want to aggregate anything in that case because 333333 is less then 2222222222222222222, but elastic starts aggregation:</p>
  
  <pre><code>{
      "_shards": {
          "failed": 0, 
          "successful": 1, 
          "total": 1
      }, 
      "aggregations": {
          "venues": {
              "buckets": [
                  {
                      "doc_count": 1, 
                      "genders": {
                          "buckets": [
                              {
                                  "doc_count": 1, 
                                  "key": "true"
                              }
                          ]
                      }, 
                      "key": "5229774711d2a3ec9e333d00"
                  }
              ]
          }
      }, 
      "hits": {
          "hits": [], 
          "max_score": null, 
          "total": 0
      }, 
      "timed_out": false, 
      "took": 1
  }
  </code></pre>
  
  <p>Please help me to deal with is. Thanks for reading this long question.</p>