46 lines
1.6 KiB
Plaintext
46 lines
1.6 KiB
Plaintext
[[indices-flush]]
|
|
== Flush
|
|
|
|
The flush API allows to flush one or more indices through an API. The
|
|
flush process of an index basically frees memory from the index by
|
|
flushing data to the index storage and clearing the internal
|
|
<<index-modules-translog,transaction log>>. By
|
|
default, Elasticsearch uses memory heuristics in order to automatically
|
|
trigger flush operations as required in order to clear memory.
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
$ curl -XPOST 'http://localhost:9200/twitter/_flush'
|
|
--------------------------------------------------
|
|
|
|
[float]
|
|
[[flush-parameters]]
|
|
=== Request Parameters
|
|
|
|
The flush API accepts the following request parameters:
|
|
|
|
[horizontal]
|
|
`wait_if_ongoing`:: If set to `true` the flush operation will block until the
|
|
flush can be executed if another flush operation is already executing.
|
|
The default is `false` and will cause an exception to be thrown on
|
|
the shard level if another flush operation is already running.
|
|
|
|
`force`:: Whether a flush should be forced even if it is not necessarily needed ie.
|
|
if no changes will be committed to the index. This is useful if transaction log IDs
|
|
should be incremented even if no uncommitted changes are present.
|
|
(This setting can be considered as internal)
|
|
|
|
[float]
|
|
[[flush-multi-index]]
|
|
=== Multi Index
|
|
|
|
The flush API can be applied to more than one index with a single call,
|
|
or even on `_all` the indices.
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
$ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_flush'
|
|
|
|
$ curl -XPOST 'http://localhost:9200/_flush'
|
|
--------------------------------------------------
|