# ES response limited to 10

**URL:** <https://discuss.elastic.co/t/es-response-limited-to-10/8301>\
**Category:** Elasticsearch\
**Created:** [July 3, 2012, 7:11pm UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301 "2012-07-03T19:11:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiyan\_2](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@saiyan\_2](https://discuss.elastic.co/u/saiyan_2)\
**Post date:** [July 3, 2012, 7:11pm UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301/1 "2012-07-03T19:11:56Z")

</div>

HI,  
Once we Index the documents, search on the index is limited to 10.  
How can we increase the response limit, or fetch the entire resultset ?

Thanks  
saiyan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 3, 2012, 7:16pm UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301/2 "2012-07-03T19:16:25Z")

</div>

Default return size is 10.

> **[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.

Fetching the entire result set is not efficient if you have many  
documents. The scan search type would be better suited for this task:

> **[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.

> **[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.

--  
Ivan

On Tue, Jul 3, 2012 at 12:11 PM, saiyan [sadhuajaykumar@gmail.com](mailto:sadhuajaykumar@gmail.com) wrote:

> HI,  
> Once we Index the documents, search on the index is limited to 10.  
> How can we increase the response limit, or fetch the entire resultset ?
> 
> Thanks  
> saiyan

---

<div class="post-metadata">

**Author:** ![saiyan\_2](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@saiyan\_2](https://discuss.elastic.co/u/saiyan_2)\
**Post date:** [July 16, 2012, 7:08am UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301/3 "2012-07-16T07:08:03Z")

</div>

Thanks Ivan for your reply.

GET [http://localhost:9200/twitter/tweet/\_search?q=user:ES&size=2](http://localhost:9200/twitter/tweet/_search?q=user:ES&size=2)

is working fine, but if the same query when given in request body(as below) shows 10 results,

GET [http://localhost:9200/twitter/tweet/\_search](http://localhost:9200/twitter/tweet/_search)  
{  
"from" : 0, "size" : 2,  
"query" : {  
"term" : { "user" : "ES" }  
}  
}

The same has been tried with search\_type options,  
guess the size parameter is not being taken from request body.

Thanks

On Wednesday, 4 July 2012 00:46:25 UTC+5:30, Ivan Brusic wrote:

> Default return size is 10.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> 
> Fetching the entire result set is not efficient if you have many  
> documents. The scan search type would be better suited for this task:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/search-type.html)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/scroll.html)
> 
> --  
> Ivan
> 
> On Tue, Jul 3, 2012 at 12:11 PM, saiyan [sadhuajaykumar@gmail.com](mailto:sadhuajaykumar@gmail.com) wrote:
> 
> > HI,  
> > Once we Index the documents, search on the index is limited to 10.  
> > How can we increase the response limit, or fetch the entire resultset ?
> > 
> > Thanks  
> > saiyan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 18, 2012, 4:47pm UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301/4 "2012-07-18T16:47:05Z")

</div>

I use the Java API, so I am not too familiar with the REST syntax.  
When in doubt, look at the code on github to find out what parameters  
are supported.

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java)  
[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/search/SearchRequest.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/search/SearchRequest.java)  
[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/search/internal/InternalSearchRequest.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/search/internal/InternalSearchRequest.java)

However, reading the class comments of the last class  
(InternalSearchRequest), it appears your syntax should be valid. I  
would try to do an end-to-end test case and gist the results in case  
it is a bug.

Cheers,

Ivan

--  
Ivan

On Mon, Jul 16, 2012 at 12:08 AM, saiyan [sadhuajaykumar@gmail.com](mailto:sadhuajaykumar@gmail.com) wrote:

> Thanks Ivan for your reply.
> 
> GET [http://localhost:9200/twitter/tweet/\_search?q=user:ES&size=2](http://localhost:9200/twitter/tweet/_search?q=user:ES&size=2)
> 
> is working fine, but if the same query when given in request body(as below)  
> shows 10 results,
> 
> GET [http://localhost:9200/twitter/tweet/\_search](http://localhost:9200/twitter/tweet/_search)
> 
> {  
> "from" : 0, "size" : 2,  
> "query" : {  
> "term" : { "user" : "ES" }  
> }  
> }
> 
> The same has been tried with search\_type options,  
> guess the size parameter is not being taken from request body.
> 
> Thanks
> 
> On Wednesday, 4 July 2012 00:46:25 UTC+5:30, Ivan Brusic wrote:
> 
> > Default return size is 10.
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> > 
> > Fetching the entire result set is not efficient if you have many  
> > documents. The scan search type would be better suited for this task:
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/search-type.html)  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/scroll.html)
> > 
> > --  
> > Ivan
> > 
> > On Tue, Jul 3, 2012 at 12:11 PM, saiyan [sadhuajaykumar@gmail.com](mailto:sadhuajaykumar@gmail.com) wrote:
> > 
> > > HI,  
> > > Once we Index the documents, search on the index is limited to 10.  
> > > How can we increase the response limit, or fetch the entire resultset ?
> > > 
> > > Thanks  
> > > saiyan

---

<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:19am UTC](https://discuss.elastic.co/t/es-response-limited-to-10/8301/5 "2017-07-06T03:19:56Z")

</div>


