Flushedit

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 transaction log. By default, Elasticsearch uses memory heuristics in order to automatically trigger flush operations as required in order to clear memory.

$ curl -XPOST 'http://localhost:9200/twitter/_flush'

Request Parametersedit

The flush API accepts the following request parameters:

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)

Multi Indexedit

The flush API can be applied to more than one index with a single call, or even on _all the indices.

$ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_flush'

$ curl -XPOST 'http://localhost:9200/_flush'