# Getting Document by ordinal number

**URL:** https://discuss.elastic.co/t/getting-document-by-ordinal-number/34716
**Category:** Elasticsearch
**Created:** [November 16, 2015, 6:09pm UTC](https://discuss.elastic.co/t/getting-document-by-ordinal-number/34716 "2015-11-16T18:09:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://discuss.elastic.co/u/boris)
#### Post date: [November 16, 2015, 6:09pm UTC](https://discuss.elastic.co/t/getting-document-by-ordinal-number/34716/1 "2015-11-16T18:09:05Z")

</div>

Hi!  
Our Documents have a timestamp field and query results are ordered by time.  
Is it possible to get a Document by its ordinal number in the query result instead of getting it by exact timestamp  
(timestamps may fluctuate) or reading the whole result set into memory for iteration?

\_id does not work for me as it is auto-generated.

Thanks,  
Boris

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [November 18, 2015, 3:45pm UTC](https://discuss.elastic.co/t/getting-document-by-ordinal-number/34716/2 "2015-11-18T15:45:48Z")

</div>

Hi,

I'm not quiet sure I understand the question, but if you are trying to get only the Nth document in your query result, this sounds like you can use the [`from/size`](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/search-request-from-size.html) parameters. Make sure to read about the dangers of and cost of [Deep Pagination](https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html) before using this for large N.  
In case I misunderstood the question, maybe you can rephrase it a bit and give an example of what you are trying to do.

---

<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 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/getting-document-by-ordinal-number/34716/3 "2017-07-05T23:37:33Z")

</div>


