# setFrom() method of SearchRequestBuilder class only accepts a int value

**URL:** https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959
**Category:** Elasticsearch
**Created:** [June 4, 2012, 9:27am UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959 "2012-06-04T09:27:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kanishk](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kanishk](https://discuss.elastic.co/u/kanishk)
#### Post date: [June 4, 2012, 9:27am UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/1 "2012-06-04T09:27:51Z")

</div>

setFrom() method of SearchRequestBuilder class only accept a int value, so if i have to fetch record which is greater than a int value (2147483647) for example -

SearchRequestBuilder.setFrom(21474836478)

The above value is not accepted as it is greater than maximum integer value.

So is it possible to pass Long as a parameter in setFrom() as parameter or is there any other API of elasticsearch which i can use to fetch results for more than max int value (i.e. 2147483647) ?

Thanks

---

<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: [June 4, 2012, 12:23pm UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/2 "2012-06-04T12:23:28Z")

</div>

Heya,

So, you mean that you have a use case where the user wants to display the 21 474  
836 478th doc ?

Really ?

I'm curious to know what is exactly the use case.

Do you want to extract data from elasticsearch ?

David.

Le 4 juin 2012 à 11:27, kanishk [kanishk.bhandari@fisglobal.com](mailto:kanishk.bhandari@fisglobal.com) a écrit :

> setFrom() method of SearchRequestBuilder class only accept a int value, so  
> if i have to fetch record which is greater than a int value (2147483647) for  
> example -
> 
> SearchRequestBuilder.setFrom(21474836478)
> 
> The above value is not accepted as it is greater than maximum integer value.
> 
> So is it possible to pass Long as a parameter in setFrom() as parameter or  
> is there any other API of elasticsearch which i can use to fetch results for  
> more than max int value (i.e. 2147483647) ?
> 
> Thanks
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762.html](http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

### Author: ![kanishk](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kanishk](https://discuss.elastic.co/u/kanishk)
#### Post date: [June 4, 2012, 12:40pm UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/3 "2012-06-04T12:40:46Z")

</div>

Yes user need to display the 21 474 836 478th record or beyond that but since the from query does not accept a long value i cannot pass the 21 474 836 478th value.

---

<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: [June 4, 2012, 1:02pm UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/4 "2012-06-04T13:02:43Z")

</div>

So, you mean that if the user can get 10 results per page, he will click 2 147  
483 647 times to get the last result ?  
And this latest documents are important as the first ones ?

I still don't understand your use case.

When I search "test" in google, I get only the first ten pages (so about 100  
documents) of about 3 140 000 000 documents.  
I can't go to the 3 140 000 000th documents. I will scroll during many years  
before getting the last result.

Le 4 juin 2012 à 14:40, kanishk [kanishk.bhandari@fisglobal.com](mailto:kanishk.bhandari@fisglobal.com) a écrit :

> Yes user need to display the 21 474 836 478th record or beyond that but since  
> the from query does not accept a long value i cannot pass the 21 474 836  
> 478th value.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762p4018773.html](http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762p4018773.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

### Author: ![kanishk](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kanishk](https://discuss.elastic.co/u/kanishk)
#### Post date: [June 4, 2012, 1:36pm UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/5 "2012-06-04T13:36:07Z")

</div>

Practically yes it is not possible, but still if i need display large data sets is their any possibility in Elastic search.

Do we have any other API to fetch large data sets?

Thanks

---

<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: [June 4, 2012, 1:43pm UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/6 "2012-06-04T13:43:00Z")

</div>

Yes. You could use scroll API :

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

David.

Le 4 juin 2012 à 15:36, kanishk [kanishk.bhandari@fisglobal.com](mailto:kanishk.bhandari@fisglobal.com) a écrit :

> Practically yes it is not possible, but still if i need display large data  
> sets is their any possibility in Elastic search.
> 
> Do we have any other API to fetch large data sets?
> 
> Thanks
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762p4018778.html](http://elasticsearch-users.115913.n3.nabble.com/setFrom-method-of-SearchRequestBuilder-class-only-accepts-a-int-value-tp4018762p4018778.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

### Author: ![kanishk](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kanishk](https://discuss.elastic.co/u/kanishk)
#### Post date: [June 5, 2012, 7:52am UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/7 "2012-06-05T07:52:05Z")

</div>

Thanks for your support David.

---

<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:25am UTC](https://discuss.elastic.co/t/setfrom-method-of-searchrequestbuilder-class-only-accepts-a-int-value/7959/8 "2017-07-06T03:25:38Z")

</div>


