# Java API, returnrned result count vs total count

**URL:** <https://discuss.elastic.co/t/java-api-returnrned-result-count-vs-total-count/11406>\
**Category:** Elasticsearch\
**Created:** [April 1, 2013, 9:02pm UTC](https://discuss.elastic.co/t/java-api-returnrned-result-count-vs-total-count/11406 "2013-04-01T21:02:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Chambers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_chambers/32/607_2.png) [@Matt\_Chambers](https://discuss.elastic.co/u/Matt_Chambers)\
**Post date:** [April 1, 2013, 9:02pm UTC](https://discuss.elastic.co/t/java-api-returnrned-result-count-vs-total-count/11406/1 "2013-04-01T21:02:35Z")

</div>

Hello,

I can't find Javadocs for ElasticSearch online anywhere and they don't seem  
to be part of the 0.9RC1 maven repo, so I have a simple question.

I have a SearchResponse, I can get the total number of items in the  
returned result, but how do I get the total number of items including items  
not returned in the result?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mkleen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mkleen/32/1694_2.png) [@mkleen](https://discuss.elastic.co/u/mkleen)\
**Post date:** [April 1, 2013, 9:28pm UTC](https://discuss.elastic.co/t/java-api-returnrned-result-count-vs-total-count/11406/2 "2013-04-01T21:28:51Z")

</div>

Hi Matt,

try org.elasticsearch.action.search.SearchResponse.getHits().getTotalHits()

Michael

On Monday, April 1, 2013 11:02:35 PM UTC+2, Matt Chambers wrote:

> Hello,
> 
> I can't find Javadocs for Elasticsearch online anywhere and they don't  
> seem to be part of the 0.9RC1 maven repo, so I have a simple question.
> 
> I have a SearchResponse, I can get the total number of items in the  
> returned result, but how do I get the total number of items including items  
> not returned in the result?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:43am UTC](https://discuss.elastic.co/t/java-api-returnrned-result-count-vs-total-count/11406/3 "2017-07-06T02:43:20Z")

</div>


