Returning the number of results which match a large query?

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

Try the count api : for ex.

More details : Count API | Elasticsearch Guide [8.1] | Elastic

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

Yes ,that's right !

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