# Confusion in setsize

**URL:** <https://discuss.elastic.co/t/confusion-in-setsize/9533>\
**Category:** Elasticsearch\
**Created:** [November 2, 2012, 5:15pm UTC](https://discuss.elastic.co/t/confusion-in-setsize/9533 "2012-11-02T17:15:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smhdiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smhdiu/32/1808_2.png) [@smhdiu](https://discuss.elastic.co/u/smhdiu)\
**Post date:** [November 2, 2012, 5:15pm UTC](https://discuss.elastic.co/t/confusion-in-setsize/9533/1 "2012-11-02T17:15:49Z")

</div>

hello all

if i am putting 40 as size as below, i am getting response within a second

searchRequestBuilder.setFrom(0).setSize(40).setExplain(true);

but if it is more than 40000 it takes 5 to 6 second to parse the request

any suggestion for faster retrieval.

Thanks in advanced.

Mohsin

--

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [November 2, 2012, 5:38pm UTC](https://discuss.elastic.co/t/confusion-in-setsize/9533/2 "2012-11-02T17:38:36Z")

</div>

Hello!

For larger amount of data consider using scroll - [http://www.elasticsearch.org/guide/reference/api/search/scroll.html](http://www.elasticsearch.org/guide/reference/api/search/scroll.html)

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

hello all

if i am putting 40 as size as below, i am getting response within a second

searchRequestBuilder.setFrom(0).setSize(40).setExplain(true);

but if it is more than 40000 it takes 5 to 6 second to parse the request

any suggestion for faster retrieval.

Thanks in advanced.

Mohsin

--

---

<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, 3:06am UTC](https://discuss.elastic.co/t/confusion-in-setsize/9533/3 "2017-07-06T03:06:24Z")

</div>


