title: ElasticSearch Date Field Statistics
body: <p>Inside my ElasticSearch index I have a type with a date field. I would like to get statistics for this field, such as which is the maximum and the minimum date, how many documents per month/year were published. I tried the following query:</p>
  
  <pre><code>  "query":{
         "match_all": {}
      }, 
     "facets":{
          "histo1":{
             "date_histogram":{
                  "field":"published_date", 
                   "interval":"year"}
                   }
              }
  </code></pre>
  
  <p>but it returns me data that I do not know how to interpret:</p>
  
  <pre><code>  "facets" : {
  "histo1" : {
    "_type" : "date_histogram",
    "entries" : [ {
      "time" : -946771200000,
      "count" : 23957
    }, {
      "time" : -915148800000,
      "count" : 45362
    }, {
      "time" : -883612800000,
      "count" : 34568
    }]
  }
  </code></pre>
  
  <p>I would have expected to see the count for each year, the time value seems like a black box. Am I doing any mistake? I get the same when I try to use month.</p>
  
  <p>Thank you very much!</p>