Count
The count API gives you quick access to the number of documents that match a query. You can also use it to check the document count of an index, data stream, or cluster.
To see the number of documents that match a query:
{
"query": {
"response": "200"
}
},
"size": 0,
"track_total_hits": true
}
To see the number of documents in an index:
To check for the number of documents in a data stream, replace the index name with the data stream name.
GET _count
Alternatively, you could use the and cat count APIs to see the number of documents per index or data stream.
All count parameters are optional.
"count" : 14074,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
}