# Pagination and limit max number of pages

**URL:** <https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096>\
**Category:** Elasticsearch\
**Created:** [April 6, 2018, 1:04pm UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096 "2018-04-06T13:04:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrader](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rrader](https://discuss.elastic.co/u/rrader)\
**Post date:** [April 6, 2018, 1:04pm UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096/1 "2018-04-06T13:04:08Z")

</div>

We want to filter products, by search term, category, price, location, and a few more.

In Elasticsearch deep paging is problematic, but if we limit to 20 items per page and max number of pages to 100, will be this ok?

[https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html)

---

<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:** [April 6, 2018, 1:15pm UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096/2 "2018-04-06T13:15:02Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![rrader](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rrader](https://discuss.elastic.co/u/rrader)\
**Post date:** [April 7, 2018, 7:01am UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096/3 "2018-04-07T07:01:50Z")

</div>

Thanks.

So query will still be performant/effective?

---

<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:** [April 7, 2018, 8:43am UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096/4 "2018-04-07T08:43:21Z")

</div>

Yes. The lower from+size is the faster the execution is though.  
Also doing that on one shard vs 100 shards also matters.

But I'd say: give it a try and you will see that with actual data and real queries.

---

<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:** [May 5, 2018, 8:43am UTC](https://discuss.elastic.co/t/pagination-and-limit-max-number-of-pages/127096/5 "2018-05-05T08:43:39Z")

</div>

Closed on May 5, 2018, 8:43am UTC

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