# Get the last , second last Document

**URL:** <https://discuss.elastic.co/t/get-the-last-second-last-document/153330>\
**Category:** Elasticsearch\
**Created:** [October 22, 2018, 7:08am UTC](https://discuss.elastic.co/t/get-the-last-second-last-document/153330 "2018-10-22T07:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![niraj\_pandey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_pandey/32/44034_2.png) [@niraj\_pandey](https://discuss.elastic.co/u/niraj_pandey)\
**Post date:** [October 22, 2018, 7:08am UTC](https://discuss.elastic.co/t/get-the-last-second-last-document/153330/1 "2018-10-22T07:08:24Z")

</div>

Hi ,

While using size = 1 we get the last document (@timestamp is in desc order) from ES cluster .  
Is there any way like the above get the second last , third last document from elastic cluster ?

---

<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:** [October 22, 2018, 7:19am UTC](https://discuss.elastic.co/t/get-the-last-second-last-document/153330/2 "2018-10-22T07:19:37Z")

</div>

You can use `from=0` to get the 1st document then `from=1` to get the next one, then `from=2` to get the next one...

---

<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:** [November 19, 2018, 7:19am UTC](https://discuss.elastic.co/t/get-the-last-second-last-document/153330/3 "2018-11-19T07:19:37Z")

</div>

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