# Elasticsearch Pagination

**URL:** <https://discuss.elastic.co/t/elasticsearch-pagination/62378>\
**Category:** Elasticsearch\
**Created:** [October 6, 2016, 12:31pm UTC](https://discuss.elastic.co/t/elasticsearch-pagination/62378 "2016-10-06T12:31:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreeram](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sreeram](https://discuss.elastic.co/u/sreeram)\
**Post date:** [October 6, 2016, 12:31pm UTC](https://discuss.elastic.co/t/elasticsearch-pagination/62378/1 "2016-10-06T12:31:58Z")

</div>

Hi,

In my .Net application, i'm using Elasticsearch 2.3.4 as search engine.

In my UserInterface layer, i want to implement pagination to display retrieved response.

I'm trying to understand Pagination (From & Size) Vs Scroll in detailed. ( **Any inputs reg. this is really appreciated.** )

**Clarifications:**

1. **Using Pagination** (From & Size), while traversing (Progressive scrolling) between pages will there any phantom reads? If yes, how to handle it ?  
For Ex.: Consider as below,  
Total number of docs. filtered : 30  
Page Size : 10

Now while traversing between 3 pages, 10 new docs. got inserted. I still want to display only the 30 docs (without 10 new docs) in my user interface. How to implement this ?

1. **Using Scroll** , In my user interface On "Next Page" click (Progressive scrolling) I'll issue scroll\_id received in previous response instead of scrolling thro all docs at once .  
For Ex.: Consider as below,  
Total number of docs. filtered : 30  
Page Size : 10  
Scroll Time : 20ms

Now the 10 docs & scroll\_id issued in first search request will be returned to UserInterface and On "Next page" click scroll request will be placed with the received scroll\_id.  
How to handle "Previous page" Click ?  
Is there any way to set expiry for Scroll\_id ?

Regards,  
Sreeram

---

<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, 10:14pm UTC](https://discuss.elastic.co/t/elasticsearch-pagination/62378/2 "2017-07-05T22:14:19Z")

</div>


