# To get total number of documents

**URL:** <https://discuss.elastic.co/t/to-get-total-number-of-documents/5537>\
**Category:** Elasticsearch\
**Created:** [October 7, 2011, 6:05am UTC](https://discuss.elastic.co/t/to-get-total-number-of-documents/5537 "2011-10-07T06:05:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arien](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@arien](https://discuss.elastic.co/u/arien)\
**Post date:** [October 7, 2011, 6:05am UTC](https://discuss.elastic.co/t/to-get-total-number-of-documents/5537/1 "2011-10-07T06:05:59Z")

</div>

Hi;  
I want to fetch total number documents in an Index without using any  
query.I found the count api but for that query is required where i am  
only concerned with getting count of documents without query.

Thanks;

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [October 7, 2011, 6:15am UTC](https://discuss.elastic.co/t/to-get-total-number-of-documents/5537/2 "2011-10-07T06:15:30Z")

</div>

Hi,

Check admin API, it can tell you total no. of docs (per cluster, per node,  
per index...). Do not remember from the top of my head which API exactly  
that is, you have to try.

Regards,  
Lukas  
Dne 7.10.2011 8:06 "arien" [ajaypadvi@gmail.com](mailto:ajaypadvi@gmail.com) napsal(a):

> Hi;  
> I want to fetch total number documents in an Index without using any  
> query.I found the count api but for that query is required where i am  
> only concerned with getting count of documents without query.
> 
> Thanks;

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 8, 2011, 6:38pm UTC](https://discuss.elastic.co/t/to-get-total-number-of-documents/5537/3 "2011-10-08T18:38:21Z")

</div>

You can send a count request with a match all query, or, simplified using  
the 'q' URI parameter, for example: curl 'host:9200/my\_index/\_count?q=\*'. In  
master (coming 0.18), if you don't specify a query, it will default to a  
"match\_all" query.

On Fri, Oct 7, 2011 at 8:05 AM, arien [ajaypadvi@gmail.com](mailto:ajaypadvi@gmail.com) wrote:

> Hi;  
> I want to fetch total number documents in an Index without using any  
> query.I found the count api but for that query is required where i am  
> only concerned with getting count of documents without query.
> 
> Thanks;

---

<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:52am UTC](https://discuss.elastic.co/t/to-get-total-number-of-documents/5537/4 "2017-07-06T03:52:34Z")

</div>


