Skip to content

Commit 6860319

Browse files
authored
[DOCS] Reformat flush API docs (#46875) (#47232)
1 parent 212cb15 commit 6860319

File tree

5 files changed

+110
-36
lines changed

5 files changed

+110
-36
lines changed

docs/reference/index-modules/allocation/delayed.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ this scenario:
2828
If the master had just waited for a few minutes, then the missing shards could
2929
have been re-allocated to Node 5 with the minimum of network traffic. This
3030
process would be even quicker for idle shards (shards not receiving indexing
31-
requests) which have been automatically <<synced-flush-api,sync-flushed>>.
31+
requests) which have been automatically <<indices-synced-flush-api,sync-flushed>>.
3232

3333
The allocation of replica shards which become unassigned because a node has
3434
left can be delayed with the `index.unassigned.node_left.delayed_timeout`
Lines changed: 105 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
[[indices-flush]]
2-
=== Flush
2+
=== Flush API
3+
++++
4+
<titleabbrev>Flush</titleabbrev>
5+
++++
6+
7+
Flushes one or more indices.
8+
9+
[source,js]
10+
--------------------------------------------------
11+
POST /twitter/_flush
12+
--------------------------------------------------
13+
// CONSOLE
14+
// TEST[setup:twitter]
15+
16+
17+
[[flush-api-request]]
18+
==== {api-request-title}
19+
20+
`POST /<index>/flush`
21+
22+
`GET /<index>/flush`
23+
24+
`POST /flush`
25+
26+
`GET /flush`
27+
28+
29+
[[flush-api-desc]]
30+
==== {api-description-title}
331

432
The flush API allows to flush one or more indices through an API. The
533
flush process of an index makes sure that any data that is currently only
@@ -9,47 +37,93 @@ reindexed from the transaction logs after the Lucene indexed is opened. By
937
default, Elasticsearch uses heuristics in order to automatically
1038
trigger flushes as required. It is rare for users to need to call the API directly.
1139

12-
[source,js]
13-
--------------------------------------------------
14-
POST twitter/_flush
15-
--------------------------------------------------
16-
// CONSOLE
17-
// TEST[setup:twitter]
1840

19-
[float]
20-
[[flush-parameters]]
21-
==== Request Parameters
41+
[[flush-api-path-params]]
42+
==== {api-path-parms-title}
2243

23-
The flush API accepts the following request parameters:
44+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
45+
+
46+
To flush all indices,
47+
omit this parameter
48+
or use a value of `_all` or `*`.
2449

25-
[horizontal]
26-
`wait_if_ongoing`:: If set to `true`(the default value) the flush operation will
27-
block until the flush can be executed if another flush operation is already executing.
2850

29-
`force`:: Whether a flush should be forced even if it is not necessarily needed i.e.
30-
if no changes will be committed to the index. This is useful if transaction log IDs
31-
should be incremented even if no uncommitted changes are present.
32-
(This setting can be considered as internal)
51+
[[flush-api-query-params]]
52+
==== {api-query-parms-title}
3353

34-
[float]
35-
[[flush-multi-index]]
36-
==== Multi Index
54+
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
55+
56+
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
57+
+
58+
Defaults to `open`.
3759

38-
The flush API can be applied to more than one index with a single call,
39-
or even on `_all` the indices.
60+
`force`::
61+
+
62+
--
63+
(Optional, boolean)
64+
If `true`,
65+
the request forces a flush
66+
even if there are no changes to commit to the index.
67+
Defaults to `true`.
68+
69+
You can use this parameter
70+
to increment the generation number of the transaction log.
71+
72+
This parameter is considered internal.
73+
--
74+
75+
76+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
77+
78+
`wait_if_ongoing`::
79+
+
80+
--
81+
(Optional, boolean)
82+
If `true`,
83+
the flush operation blocks until execution
84+
when another flush operation is running.
85+
86+
87+
If `false`,
88+
{es} returns an error
89+
if you request a flush
90+
when another flush operation is running.
91+
92+
Defaults to `true`.
93+
--
94+
95+
96+
[[flush-api-example]]
97+
==== {api-examples-title}
98+
99+
100+
[[flush-api-specific-ex]]
101+
===== Flush a specific index
40102

41103
[source,js]
42-
--------------------------------------------------
43-
POST kimchy,elasticsearch/_flush
104+
----
105+
POST /kimchy/_flush
106+
----
107+
// CONSOLE
108+
// TEST[s/^/PUT kimchy\n/]
44109

45-
POST _flush
46-
--------------------------------------------------
110+
111+
[[flush-multi-index]]
112+
===== Flush several indices
113+
114+
[source,js]
115+
----
116+
POST /kimchy,elasticsearch/_flush
117+
----
47118
// CONSOLE
48119
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/]
49120

50121

51-
[float]
52-
[[synced-flush-api]]
53-
==== Synced Flush
122+
[[flush-api-all-ex]]
123+
===== Flush all indices
54124

55-
See <<indices-synced-flush-api>>.
125+
[source,js]
126+
----
127+
POST /_flush
128+
----
129+
// CONSOLE

docs/reference/redirects.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ See <<explain-analyze-api>>.
760760

761761
[role="exclude",id="indices-synced-flush"]
762762
=== Synced flush API
763-
See <<synced-flush-api>>.
763+
See <<indices-synced-flush-api>>.
764764

765765
[role="exclude",id="ccs-reduction"]
766766
=== {ccs-cap} reduction

docs/reference/upgrade/cluster_restart.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include::disable-shard-alloc.asciidoc[]
2020
. *Stop indexing and perform a synced flush.*
2121
+
2222
--
23-
Performing a <<synced-flush-api, synced-flush>> speeds up shard
23+
Performing a <<indices-synced-flush-api, synced-flush>> speeds up shard
2424
recovery.
2525

2626
include::synced-flush.asciidoc[]

docs/reference/upgrade/rolling_upgrade.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include::disable-shard-alloc.asciidoc[]
2929
--
3030
While you can continue indexing during the upgrade, shard recovery
3131
is much faster if you temporarily stop non-essential indexing and perform a
32-
<<synced-flush-api, synced-flush>>.
32+
<<indices-synced-flush-api, synced-flush>>.
3333

3434
include::synced-flush.asciidoc[]
3535

@@ -132,7 +132,7 @@ As soon as another node is upgraded, the replicas can be assigned and the
132132
status will change to `green`.
133133
====================================================
134134

135-
Shards that were not <<synced-flush-api,sync-flushed>> might take longer to
135+
Shards that were not <<indices-synced-flush-api,sync-flushed>> might take longer to
136136
recover. You can monitor the recovery status of individual shards by
137137
submitting a <<cat-recovery,`_cat/recovery`>> request:
138138

0 commit comments

Comments
 (0)