cat count APIedit

Provides quick access to a document count of individual indices or all indices in a cluster.

Note

The document count only includes live documents, not deleted documents which have not yet been removed by the merge process.

Requestedit

GET /_cat/count/{index}

Path parametersedit

{index}
(Optional, string) Comma-separated list or wildcard expression of index names used to limit the request.

Query parametersedit

format
(Optional, string) Short version of the HTTP accept header. Valid values include JSON, YAML, etc.
h
(Optional, string) Comma-separated list of column names to display.
help
(Optional, boolean) If true, the response returns help information. Defaults to false.
local
(Optional, boolean) If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
master_timeout
(Optional, time units) Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.
s
(Optional, string) Comma-separated list of column names or column aliases used to sort the response.
v
(Optional, boolean) If true, the response includes column headings. Defaults to false.

Examplesedit

Example with an individual indexedit

The following count API request retrieves the document count of a single index, twitter.

GET /_cat/count/twitter?v

The API returns the following response:

epoch      timestamp count
1475868259 15:24:20  120

Example with all indices in a clusteredit

The following count API request retrieves the document count of all indices in the cluster.

GET /_cat/count?v

The API returns the following response:

epoch      timestamp count
1475868259 15:24:20  121