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.
So I have few records with same session id but different timestamp.
I'm trying to create a date_histogram
with unique session ids from users records.
Creating the histogram without the uniqueness is easy:
{
"aggs" : {
"users_sessions" : {
"date_histogram" : {
"field" : "date",
"interval" : "1h"
}
}
}
}
But is it possible to have such date histogram with unique values (for example, with the first occurrence of each unique session id)?