title: Date histogram of unique values
body: <p>I am using Elasticsearch 2.3 and for each web page a user visits in my website I produce a record with user session id and current timestamp.<br />So I have few records with same session id but different timestamp.<br />
  I'm trying to create a <code>date_histogram</code> with unique session ids from users records.</p>
  
  <p>Creating the histogram without the uniqueness is easy:</p>
  
  <pre><code>{
      "aggs" : {
          "users_sessions" : {
              "date_histogram" : {
                  "field" : "date",
                  "interval" : "1h"
              }
          }
      }
  }
  </code></pre>
  
  <p>But is it possible to have such date histogram with unique values (for example, with the first occurrence of each unique session id)?</p>