# Hard limit on results

**URL:** <https://discuss.elastic.co/t/hard-limit-on-results/49545>\
**Category:** Elasticsearch\
**Created:** [May 9, 2016, 12:19pm UTC](https://discuss.elastic.co/t/hard-limit-on-results/49545 "2016-05-09T12:19:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tominator](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@Tominator](https://discuss.elastic.co/u/Tominator)\
**Post date:** [May 9, 2016, 12:19pm UTC](https://discuss.elastic.co/t/hard-limit-on-results/49545/1 "2016-05-09T12:19:30Z")

</div>

Hi,

I'm trying to return at most 100 results in my search. I know I can work with "from" and "size", but these still return the aggregates and hits['total'] for all possible results (more than 100).

Since I'm using automatic pagination and a nice display for the aggregations on my site, I can't hardcode the limit in the front-end. I do still want to use pagination (for example 25 results per page, so 4 pages in my case).

What would be the best way to limit the results _and_ aggregations to return only the first x number of results (paginate-able)?

Best regards!

---

<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:53pm UTC](https://discuss.elastic.co/t/hard-limit-on-results/49545/2 "2017-07-05T22:53:01Z")

</div>


