# Create bucket of 2 documents - Elasticsearch

**URL:** <https://discuss.elastic.co/t/create-bucket-of-2-documents-elasticsearch/91548>\
**Category:** Elasticsearch\
**Created:** [July 2, 2017, 9:59am UTC](https://discuss.elastic.co/t/create-bucket-of-2-documents-elasticsearch/91548 "2017-07-02T09:59:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omsaran](https://avatars.discourse-cdn.com/v4/letter/o/f17d59/32.png) [@omsaran](https://discuss.elastic.co/u/omsaran)\
**Post date:** [July 2, 2017, 9:59am UTC](https://discuss.elastic.co/t/create-bucket-of-2-documents-elasticsearch/91548/1 "2017-07-02T09:59:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 2, 2017, 11:45am UTC](https://discuss.elastic.co/t/create-bucket-of-2-documents-elasticsearch/91548/2 "2017-07-02T11:45:12Z")

</div>

I'm not sure you can do that.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 30, 2017, 11:45am UTC](https://discuss.elastic.co/t/create-bucket-of-2-documents-elasticsearch/91548/3 "2017-07-30T11:45:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
