# Returning the number of results which match a large query?

**URL:** <https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275>\
**Category:** Elasticsearch\
**Created:** [April 1, 2022, 12:37am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275 "2022-04-01T00:37:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![catmanjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catmanjan/32/77810_2.png) [@catmanjan](https://discuss.elastic.co/u/catmanjan)\
**Post date:** [April 1, 2022, 12:37am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275/1 "2022-04-01T00:37:59Z")

</div>

I have an index with 100 million documents

What's the fastest way for me to count the number of documents which meet a certain query? I don't want the documents, just the number of documents that match the query.

I am expecting a count of around 60 million for this query, but I want a precise count, e.g. 60,001,351 results

---

<div class="post-metadata">

**Author:** ![DineshNaik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dineshnaik/32/89308_2.png) [@DineshNaik](https://discuss.elastic.co/u/DineshNaik)\
**Post date:** [April 1, 2022, 3:12am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275/2 "2022-04-01T03:12:16Z")

</div>

Try the count api : for ex.  
my-index-000001/\_count?q=user:kimchy

More details : [Count API | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html#search-count)

---

<div class="post-metadata">

**Author:** ![catmanjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catmanjan/32/77810_2.png) [@catmanjan](https://discuss.elastic.co/u/catmanjan)\
**Post date:** [April 1, 2022, 3:25am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275/3 "2022-04-01T03:25:41Z")

</div>

Thanks, so this isn't limited by the 10,000 max count?

---

<div class="post-metadata">

**Author:** ![DineshNaik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dineshnaik/32/89308_2.png) [@DineshNaik](https://discuss.elastic.co/u/DineshNaik)\
**Post date:** [April 1, 2022, 4:27am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275/4 "2022-04-01T04:27:33Z")

</div>

Yes ,that's right !

---

<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:** [April 29, 2022, 4:28am UTC](https://discuss.elastic.co/t/returning-the-number-of-results-which-match-a-large-query/301275/5 "2022-04-29T04:28:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
