Flush API

Flushes one or more indices.

POST /twitter/_flush


POST /<index>/_flush

GET /<index>/_flush

POST /_flush

GET /_flush


The flush API allows to flush one or more indices through an API. The flush process of an index makes sure that any data that is currently only persisted in the transaction log is also permanently persisted in Lucene. This reduces recovery times as that data doesn’t need to be reindexed from the transaction logs after the Lucene indexed is opened. By default, Elasticsearch uses heuristics in order to automatically trigger flushes as required. It is rare for users to need to call the API directly.

Path parameters


(Optional, string) Comma-separated list or wildcard expression of index names used to limit the request.

To flush all indices, omit this parameter or use a value of _all or *.

Query parameters


(Optional, boolean) If true, the request does not return an error if a wildcard expression or _all value retrieves only missing or closed indices.

This parameter also applies to index aliases that point to a missing or closed index.


(Optional, string) Controls what kind of indices that wildcard expressions can expand to. Valid values are:

Expand to open and closed indices.
Expand only to open indices.
Expand only to closed indices.
Wildcard expressions are not accepted.

Defaults to open.


(Optional, boolean) If true, the request forces a flush even if there are no changes to commit to the index. Defaults to true.

You can use this parameter to increment the generation number of the transaction log.

This parameter is considered internal.

(Optional, boolean) If true, missing or closed indices are not included in the response. Defaults to false.

(Optional, boolean) If true, the flush operation blocks until execution when another flush operation is running.

If false, Elasticsearch returns an error if you request a flush when another flush operation is running.

Defaults to true.


Flush a specific index

POST /kimchy/_flush

Flush several indices

POST /kimchy,elasticsearch/_flush

Flush all indices

POST /_flush