# How to get the specific document from search response Object

**URL:** <https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855>\
**Category:** Elasticsearch\
**Created:** [September 19, 2016, 9:19am UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855 "2016-09-19T09:19:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad\_kp](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@prasad\_kp](https://discuss.elastic.co/u/prasad_kp)\
**Post date:** [September 19, 2016, 9:19am UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855/1 "2016-09-19T09:19:06Z")

</div>

Hi Guys,

SearchResponse response = srb.execute().actionGet();

I have 100 documents in my response object,but  
I want to get the response from 20 th document to 40 th document from this reponse object .

Thanks for your help in advance.

---

<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:** [September 19, 2016, 9:49am UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855/2 "2016-09-19T09:49:00Z")

</div>

Something like `response.getHits().getHits()[20]` ?

---

<div class="post-metadata">

**Author:** ![prasad\_kp](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@prasad\_kp](https://discuss.elastic.co/u/prasad_kp)\
**Post date:** [September 20, 2016, 2:33pm UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855/3 "2016-09-20T14:33:12Z")

</div>

Thanks for Your comment ,

Actually, i am sending around 67656 documents to UI from backend ,hence the performance become slow.Therefore I am trying to send the 20 documents per page ,when user clicks on second page then i need to send more 20 out of 67656 record's,

Is there any way to sort this out.

---

<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:** [September 20, 2016, 3:20pm UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855/4 "2016-09-20T15:20:54Z")

</div>

Have a look at size and from parameters then.

They are helping for pagination.

---

<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:18pm UTC](https://discuss.elastic.co/t/how-to-get-the-specific-document-from-search-response-object/60855/5 "2017-07-05T22:18:44Z")

</div>


