Search based on Document Sequencing

(Rohan Jain) #1

hey i have log files of email. A user logs in and his session created is true.HIs session end when he logs out and log file shows seesion end. Now i need to count the number of sessions of a user and for each particular session no of emails sent.

(Nik Everett) #2

I don't think this is something that Elasticsearch can answer very easily now. I'd love to be able to answer these questions efficiently though.

You could get something half way, like count the distinct number of sessions for a user and then count the number of emails they sent to get the number of emails per session. But it wouldn't exactly what you asked for.

@polyfractal and @jimferenczi might know more. Like, if we implemented some kind of session, time ordered walk of documents then it'd be possible to implement an efficiently aggregation that counts the sessions that have contain an email, right? I guess we could do something fancy with a bit set and global ordinals to count the answers too....

(Rohan Jain) #3

thanx for the answer :slight_smile:

(system) #4