Skip to content

Commit 5342168

Browse files
authored
[DOCS] Reformat flush API docs (#46875) (#47231)
1 parent a9f3aff commit 5342168

File tree

5 files changed

+108
-40
lines changed

5 files changed

+108
-40
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`

docs/reference/indices/flush.asciidoc

Lines changed: 103 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
[[indices-flush]]
2-
=== Flush
2+
=== Flush API
3+
++++
4+
<titleabbrev>Flush</titleabbrev>
5+
++++
6+
7+
Flushes one or more indices.
8+
9+
[source,console]
10+
--------------------------------------------------
11+
POST /twitter/_flush
12+
--------------------------------------------------
13+
// TEST[setup:twitter]
14+
15+
16+
[[flush-api-request]]
17+
==== {api-request-title}
18+
19+
`POST /<index>/flush`
20+
21+
`GET /<index>/flush`
22+
23+
`POST /flush`
24+
25+
`GET /flush`
26+
27+
28+
[[flush-api-desc]]
29+
==== {api-description-title}
330

431
Flushing an index is the process of making sure that any data that is currently
532
only stored in the <<index-modules-translog,transaction log>> is also
@@ -22,49 +49,90 @@ call the flush API after indexing some documents then a successful response
2249
indicates that {es} has flushed all the documents that were indexed before the
2350
flush API was called.
2451

25-
[source,js]
26-
--------------------------------------------------
27-
POST twitter/_flush
28-
--------------------------------------------------
29-
// CONSOLE
30-
// TEST[setup:twitter]
3152

32-
[float]
33-
[[flush-parameters]]
34-
==== Request Parameters
53+
[[flush-api-path-params]]
54+
==== {api-path-parms-title}
3555

36-
The flush API accepts the following request parameters:
56+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
57+
+
58+
To flush all indices,
59+
omit this parameter
60+
or use a value of `_all` or `*`.
3761

38-
[horizontal]
39-
`wait_if_ongoing`:: If set to `true` the flush operation will block until the
40-
flush can be executed if another flush operation is already executing. If set to
41-
`false` then an exception will be thrown on the shard level if another flush
42-
operation is already running. Defaults to `true`.
4362

44-
`force`:: Whether a flush should be forced even if it is not necessarily needed
45-
i.e. if no changes will be committed to the index. This can be used to force
46-
the generation number of the transaction log to be incremented even if no
47-
uncommitted changes are present. This parameter should be considered internal.
63+
[[flush-api-query-params]]
64+
==== {api-query-parms-title}
4865

49-
[float]
50-
[[flush-multi-index]]
51-
==== Multi Index
66+
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
5267

53-
The flush API can be applied to more than one index with a single call, or even
54-
on `_all` the indices.
68+
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
69+
+
70+
Defaults to `open`.
5571

56-
[source,js]
57-
--------------------------------------------------
58-
POST kimchy,elasticsearch/_flush
72+
`force`::
73+
+
74+
--
75+
(Optional, boolean)
76+
If `true`,
77+
the request forces a flush
78+
even if there are no changes to commit to the index.
79+
Defaults to `true`.
5980

60-
POST _flush
61-
--------------------------------------------------
62-
// CONSOLE
81+
You can use this parameter
82+
to increment the generation number of the transaction log.
83+
84+
This parameter is considered internal.
85+
--
86+
87+
88+
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
89+
90+
`wait_if_ongoing`::
91+
+
92+
--
93+
(Optional, boolean)
94+
If `true`,
95+
the flush operation blocks until execution
96+
when another flush operation is running.
97+
98+
99+
If `false`,
100+
{es} returns an error
101+
if you request a flush
102+
when another flush operation is running.
103+
104+
Defaults to `true`.
105+
--
106+
107+
108+
[[flush-api-example]]
109+
==== {api-examples-title}
110+
111+
112+
[[flush-api-specific-ex]]
113+
===== Flush a specific index
114+
115+
[source,console]
116+
----
117+
POST /kimchy/_flush
118+
----
119+
// TEST[s/^/PUT kimchy\n/]
120+
121+
122+
[[flush-multi-index]]
123+
===== Flush several indices
124+
125+
[source,console]
126+
----
127+
POST /kimchy,elasticsearch/_flush
128+
----
63129
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/]
64130

65131

66-
[float]
67-
[[synced-flush-api]]
68-
==== Synced Flush
132+
[[flush-api-all-ex]]
133+
===== Flush all indices
69134

70-
See <<indices-synced-flush-api>>.
135+
[source,console]
136+
----
137+
POST /_flush
138+
----

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="_repositories"]
766766
=== Snapshot repositories

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)