I have a set of documents having timestamps. I want to sort them in ascending order of timestamp and then bucket them into documents of two.
Suppose documents have timestamps 1,2,3,4
I want to bucket them into sets of two i.e 1,2 in one bucket, 2 and 4 in the next bucket. How do I do this in elasticsearch?