# Pagination of big ammount of data

**URL:** <https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386>\
**Category:** Elasticsearch\
**Created:** [July 12, 2015, 11:07am UTC](https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386 "2015-07-12T11:07:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaKro](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaKro](https://discuss.elastic.co/u/MaKro)\
**Post date:** [July 12, 2015, 11:07am UTC](https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386/1 "2015-07-12T11:07:26Z")

</div>

Hey.

I have a question about pagination of big ammount of data.

So I have an index with 2 000 000 of documents. I want to implement pagination. Documents should be ordered by date field.

I read in definitive guide that pagination for big ammount of data shouldn't be sorted, and I should use the scan and scroll feature. However, If I will use it, I will get them in wrong order.

Did I miss something in docs ? Or I can use the ES pagination (using "size" and "from" properties) but I just need a lot of nodes in my cluster ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 12, 2015, 11:10am UTC](https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386/2 "2015-07-12T11:10:25Z")

</div>

Pagination for such a large amount is not recommended.  
You may be able to do it if you have a large number of nodes, but this is something you'd need to test yourself.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 12, 2015, 11:24am UTC](https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386/3 "2015-07-12T11:24:03Z")

</div>

Pagination makes only sense on the first hundreds of documents. It is not efficient to sort 2 millions docs just to return 10 or 20 docs per page.

Consider using filters in your query to create smaller result sets (e.g. per day, per user) and sort on that subset.

---

<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 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/pagination-of-big-ammount-of-data/25386/4 "2017-07-06T00:02:05Z")

</div>


