2021-06-22 02:13:40 -04:00
|
|
|
---
|
|
|
|
layout: default
|
2022-10-31 12:21:32 -04:00
|
|
|
title: CAT count
|
|
|
|
parent: CAT API
|
2021-06-22 02:13:40 -04:00
|
|
|
nav_order: 10
|
|
|
|
has_children: false
|
2023-05-04 14:22:52 -04:00
|
|
|
redirect_from:
|
|
|
|
- /opensearch/rest-api/cat/cat-count/
|
|
|
|
|
2021-06-22 02:13:40 -04:00
|
|
|
---
|
|
|
|
|
2022-10-31 12:21:32 -04:00
|
|
|
# CAT count
|
2023-10-23 10:53:52 -04:00
|
|
|
**Introduced 1.0**
|
2021-07-26 19:14:22 -04:00
|
|
|
{: .label .label-purple }
|
2021-06-22 02:13:40 -04:00
|
|
|
|
2022-10-31 12:21:32 -04:00
|
|
|
The CAT count operation lists the number of documents in your cluster.
|
2021-06-22 02:13:40 -04:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```json
|
|
|
|
GET _cat/count?v
|
|
|
|
```
|
2023-01-30 17:09:38 -05:00
|
|
|
{% include copy-curl.html %}
|
2021-06-22 02:13:40 -04:00
|
|
|
|
|
|
|
To see the number of documents in a specific index or alias, add the index or alias name after your query:
|
|
|
|
|
|
|
|
```json
|
|
|
|
GET _cat/count/<index_or_alias>?v
|
|
|
|
```
|
2023-01-30 17:09:38 -05:00
|
|
|
{% include copy-curl.html %}
|
2021-06-22 02:13:40 -04:00
|
|
|
|
|
|
|
If you want to get information for more than one index or alias, separate the index or alias names with commas:
|
|
|
|
|
|
|
|
```json
|
2022-12-13 12:52:53 -05:00
|
|
|
GET _cat/count/index_or_alias_1,index_or_alias_2,index_or_alias_3
|
2021-06-22 02:13:40 -04:00
|
|
|
```
|
2023-01-30 17:09:38 -05:00
|
|
|
{% include copy-curl.html %}
|
2021-06-22 02:13:40 -04:00
|
|
|
|
|
|
|
## Path and HTTP methods
|
|
|
|
|
|
|
|
```
|
|
|
|
GET _cat/count?v
|
|
|
|
GET _cat/count/<index>?v
|
|
|
|
```
|
|
|
|
|
|
|
|
## URL parameters
|
|
|
|
|
2022-10-31 12:21:32 -04:00
|
|
|
All CAT count URL parameters are optional. You can specify any of the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index).
|
2021-06-22 02:13:40 -04:00
|
|
|
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
The following response shows the overall document count as 1625:
|
|
|
|
|
|
|
|
```json
|
|
|
|
epoch | timestamp | count
|
|
|
|
1624237738 | 01:08:58 | 1625
|
|
|
|
```
|