1
1
[[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}
3
30
4
31
Flushing an index is the process of making sure that any data that is currently
5
32
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
22
49
indicates that {es} has flushed all the documents that were indexed before the
23
50
flush API was called.
24
51
25
- [source,js]
26
- --------------------------------------------------
27
- POST twitter/_flush
28
- --------------------------------------------------
29
- // CONSOLE
30
- // TEST[setup:twitter]
31
52
32
- [float]
33
- [[flush-parameters]]
34
- ==== Request Parameters
53
+ [[flush-api-path-params]]
54
+ ==== {api-path-parms-title}
35
55
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 `*`.
37
61
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`.
43
62
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}
48
65
49
- [float]
50
- [[flush-multi-index]]
51
- ==== Multi Index
66
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
52
67
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`.
55
71
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`.
59
80
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
+ ----
63
129
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/]
64
130
65
131
66
- [float]
67
- [[synced-flush-api]]
68
- ==== Synced Flush
132
+ [[flush-api-all-ex]]
133
+ ===== Flush all indices
69
134
70
- See <<indices-synced-flush-api>>.
135
+ [source,console]
136
+ ----
137
+ POST /_flush
138
+ ----
0 commit comments