Skip to content

Commit 85d9a97

Browse files
committed
[DOCS] Reformat cat count API
1 parent ead4eb5 commit 85d9a97

File tree

2 files changed

+66
-15
lines changed

2 files changed

+66
-15
lines changed

docs/reference/cat/count.asciidoc

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,87 @@
11
[[cat-count]]
22
=== cat count
33

4-
`count` provides quick access to the document count of the entire
5-
cluster, or individual indices.
4+
Provides quick access to a document count of individual indices or all indices
5+
in a cluster.
6+
7+
NOTE: The document count only includes live documents, not deleted documents
8+
which have not yet been removed by the merge process.
9+
10+
11+
[[cat-count-api-request]]
12+
==== {api-request-title}
13+
14+
`GET /_cat/count/{index}`
15+
16+
17+
[[cat-count-api-path-params]]
18+
==== {api-path-parms-title}
19+
20+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
21+
22+
23+
[[cat-count-api-query-params]]
24+
==== {api-query-parms-title}
25+
26+
include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
27+
28+
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
29+
30+
include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
31+
32+
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
33+
34+
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
35+
36+
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
37+
38+
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
39+
40+
41+
[[cat-count-api-example]]
42+
==== {api-examples-title}
43+
44+
[[cat-count-api-example-ind]]
45+
==== Example with an individual index
46+
47+
The following `count` API request retrieves the document count of a single
48+
index, `twitter`.
649

750
[source,js]
851
--------------------------------------------------
9-
GET /_cat/count?v
52+
GET /_cat/count/twitter?v
1053
--------------------------------------------------
1154
// CONSOLE
12-
// TEST[setup:big_twitter]
13-
// TEST[s/^/POST test\/test\?refresh\n{"test": "test"}\n/]
55+
// TEST[continued]
1456

15-
Looks like:
57+
The API returns the following response:
1658

1759
[source,txt]
1860
--------------------------------------------------
1961
epoch timestamp count
20-
1475868259 15:24:19 121
62+
1475868259 15:24:19 120
2163
--------------------------------------------------
2264
// TESTRESPONSE[s/1475868259 15:24:19/\\d+ \\d+:\\d+:\\d+/ non_json]
2365

24-
Or for a single index:
66+
[[cat-count-api-example-all]]
67+
===== Example with all indices in a cluster
68+
69+
The following `count` API request retrieves the document count of all indices in
70+
the cluster.
2571

2672
[source,js]
2773
--------------------------------------------------
28-
GET /_cat/count/twitter?v
74+
GET /_cat/count?v
2975
--------------------------------------------------
3076
// CONSOLE
31-
// TEST[continued]
77+
// TEST[setup:big_twitter]
78+
// TEST[s/^/POST test\/test\?refresh\n{"test": "test"}\n/]
79+
80+
The API returns the following response:
3281

3382
[source,txt]
3483
--------------------------------------------------
3584
epoch timestamp count
36-
1475868259 15:24:20 120
85+
1475868259 15:24:20 121
3786
--------------------------------------------------
3887
// TESTRESPONSE[s/1475868259 15:24:20/\\d+ \\d+:\\d+:\\d+/ non_json]
39-
40-
41-
NOTE: The document count indicates the number of live documents and does not include deleted documents which have not yet been cleaned up by the merge process.

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11

2-
tag::timeoutparms[]
2+
tag::index[]
3+
`{index}`::
4+
(Optional, string) Comma-separated list of index names used to limit returned
5+
information.
6+
end::index[]
7+
38
`timeout`::
49
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
510
a response. If no response is received before the timeout expires, the request

0 commit comments

Comments
 (0)