title: Elastic search find total hits for a date
body: <p>I have a requirement to find total records in my user table for a particular date, i can able to find the total hits, but cannot find a query to fetch date for a particular date. </p>
  
  <p>Query</p>
  
  <pre><code>{
    "size": 0,
    "query": {
      "match_all": {}
    },
    "aggs": {
      "daily_team": {
        "filter": {
          "range": {
            "created_date": {
              "from": "2015-01-02",
              "to": "2015-01-02"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Result </p>
  
  <pre><code>{
     "took": 3,
     "timed_out": false,
     "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
     },
     "hits": {
        "total": 33,
        "max_score": 0,
        "hits": []
     },
     "aggregations": {
        "daily_team": {
           "doc_count": 1
        }
     }
  }
  </code></pre>
  
  <p>Here "total": 33, but its for total number of records in my database. I have only 22 records from "starting date" to "2015-01-02". Could you please help me to find query for the same. Thanks</p>