Class FlushRequest
Flushing a data stream or index is the process of making sure that any data that is currently only stored in the transaction log is also permanently stored in the Lucene index. When restarting, Elasticsearch replays any unflushed operations from the transaction log into the Lucene index to bring it back into the state that it was in before the restart. Elasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush.
After each operation has been flushed it is permanently stored in the Lucene index. This may mean that there is no need to maintain an additional copy of it in the transaction log. The transaction log is made up of multiple files, called generations, and Elasticsearch will delete any generation files when they are no longer needed, freeing up disk space.
It is also possible to trigger a flush on one or more indices using the flush API, although it is rare for users to need to call this API directly. If you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Endpoint<FlushRequest,FlushResponse, ErrorResponse> Endpoint "indices.flush". -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanA setting that does two separate checks on the index expression.final List<ExpandWildcard>Type of index that wildcard patterns can match.final Booleanforce()Iftrue, the request forces a flush even if there are no changes to commit to the index.final BooleanIffalse, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable.index()Comma-separated list of data streams, indices, and aliases to flush.static FlushRequestrebuild()final BooleanIftrue, the flush operation blocks until execution when another flush operation is running.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_ENDPOINT
Endpoint "indices.flush".
-
-
Method Details
-
of
-
allowNoIndices
A setting that does two separate checks on the index expression. Iffalse, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result.API name:
allow_no_indices -
expandWildcards
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such asopen,hidden.API name:
expand_wildcards -
force
Iftrue, the request forces a flush even if there are no changes to commit to the index.API name:
force -
index
Comma-separated list of data streams, indices, and aliases to flush. Supports wildcards (*). To flush all data streams and indices, omit this parameter or use*or_all.API name:
index -
waitIfOngoing
Iftrue, the flush operation blocks until execution when another flush operation is running. Iffalse, Elasticsearch returns an error if you request a flush when another flush operation is running.API name:
wait_if_ongoing -
rebuild
- Returns:
- New
FlushRequest.Builderinitialized with field values of this instance
-