# Records more than 10,000 with pagination

**URL:** <https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398>\
**Category:** Elasticsearch\
**Created:** [September 21, 2020, 5:01pm UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398 "2020-09-21T17:01:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pankaj\_Jadhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pankaj_jadhav/32/65896_2.png) [@Pankaj\_Jadhav](https://discuss.elastic.co/u/Pankaj_Jadhav)\
**Post date:** [September 21, 2020, 5:01pm UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/1 "2020-09-21T17:01:02Z")

</div>

Hi Team,

Am having more than 10,000 + records under elastic. Now my requirement is i've to show records to user with pagination. Am able to show records upto 10,000 with back end logic like  
elastic query  
{  
"from" : 9950,  
"size" :50  
} its returning me result

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d657b430310700bcbfbf37f31dfc919f69015c39.png)  
you can see in image 200 value is enter by user as its freetext texbox.  
when user enter more than 200 for it breaks.  
in that case So in elastic query  
{  
"from" : 10000,  
"size" :50  
}  
In my requirement its free text box so user can enter any value for pagenumber. please let me know what best I can do.

---

<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:** [September 21, 2020, 5:27pm UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/2 "2020-09-21T17:27:20Z")

</div>

I'm curious always about this use case.

Does it really make sense for an end user to access a random page?  
Why not trying to make the "best results" appearing in the first pages?

Faceted navigation could help to drill down in the results by selecting filters, using a better scoring mechanism which is closer to the use case, adding sorting on various columns... Many things you can do to make the user's life easier IMO.

So what is exactly the use case which would require to access any random document?

---

<div class="post-metadata">

**Author:** ![Pankaj\_Jadhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pankaj_jadhav/32/65896_2.png) [@Pankaj\_Jadhav](https://discuss.elastic.co/u/Pankaj_Jadhav)\
**Post date:** [September 21, 2020, 5:34pm UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/3 "2020-09-21T17:34:06Z")

</div>

@dadoonet. Thanks for your suggestion. But still my client want one page where he can see all items on grid and on same page we have pagination also. please can you guide some way.

---

<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:** [September 22, 2020, 6:56am UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/4 "2020-09-22T06:56:08Z")

</div>

Just tell your client to look at Google. And try to go to page 1056.

Anyway, here's an answer.

You can use:

- the [`size` and `from` parameters](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) to display by default up to 10000 records to your users. If you want to change this limit, you can change `index.max_result_window` setting but be aware of the consequences (ie memory).
- the [search after](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html) feature to do deep pagination.
- the [Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) if you want to extract a resultset to be consumed by another tool later.

---

<div class="post-metadata">

**Author:** ![Pankaj\_Jadhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pankaj_jadhav/32/65896_2.png) [@Pankaj\_Jadhav](https://discuss.elastic.co/u/Pankaj_Jadhav)\
**Post date:** [September 22, 2020, 6:58am UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/5 "2020-09-22T06:58:10Z")

</div>

> [@dadoonet](#):
>
> Just tell your client to look at Google. And try to go to page 1056.

_Just tell your client to look at Google. And try to go to page 1056._ 😄  
Thanks

---

<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:** [October 20, 2020, 6:58am UTC](https://discuss.elastic.co/t/records-more-than-10-000-with-pagination/249398/6 "2020-10-20T06:58:17Z")

</div>

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