stack es reindex cli command
Auth required
elastic stack es reindex --dest <dest> --source <source> [options]
Reindex documents.
Behaviour flags:
--dry-run — validate all inputs and exit without performing any action
--deststringrequired- The destination you are copying to.
--sourcestringrequired- The source you are copying from.
--refresh- If
true, the request refreshes affected shards to make this operation visible to search. --requests-per-secondnumber- The maximum number of documents to index per second, across the entire reindex operation (including slices).
It can be either
-1to turn off throttling or any decimal number like1.7or12to throttle to that level. --scrollstring- The period of time that a consistent view of the index should be maintained for scrolled search. In serverless, and stack versions >= v9.5.0, we use PIT rather than scroll for pagination. We only use scroll for reindexing from remote clusters that are older than v7.10.0. Therefore, this parameter is ignored unless you are reindexing from a remote cluster that is older than v7.10.0.
--slicesstring- The number of slices this task should be divided into.
It defaults to one slice, which means the task isn't sliced into subtasks. Reindex supports sliced scroll to parallelize the reindexing process.
This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts. NOTE: Reindexing from remote clusters does not support manual or automatic slicing. If set to
auto, Elasticsearch chooses the number of slices to use. This setting will use one slice per shard, up to a certain limit. If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards. --max-docsnumber- The maximum number of documents to reindex.
By default, all documents are reindexed.
If it is a value less then or equal to
scroll_size, a scroll will not be used to retrieve the results for the operation. Ifconflictsis set toproceed, the reindex operation could attempt to reindex more documents from the source thanmax_docsuntil it has successfully indexedmax_docsdocuments into the target or it has gone through every document in the source query. --timeoutstring- The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. By default, Elasticsearch waits for at least one minute before failing. The actual wait time could be longer, particularly when multiple waits occur.
--wait-for-active-shardsstring- The number of shard copies that must be active before proceeding with the operation.
Set it to
allor any positive integer up to the total number of shards in the index (number_of_replicas+1). The default value is one, which means it waits for each primary shard to be active. --wait-for-completion- If
true, the request blocks until the operation is complete. If your requested reindex operation is complex or time-consuming, it might timeout due to transport-layer limitations. While the reindex will continue to be processed by the cluster, your client will not receive updates on status automatically after timeout. Set this optiontrueif you anticipate a long-running reindex. --require-alias- If
true, the destination must be an index alias. --conflictsenum-
Indicates whether to continue reindexing even when there are conflicts.
Values: abort, proceed
--scriptstring- The script to run to update the document source or metadata when reindexing.
--error-trace- When set to
trueElasticsearch will include the full stack trace of errors when they occur. --filter-pathstring-
Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch.
Repeatable: pass
--filter-pathmultiple times to supply more than one value --human- When set to
truewill return statistics in a format suitable for humans. For example"exists_time": "1h"for humans and"exists_time_in_millis": 3600000for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. --pretty- If set to
truethe returned JSON will be "pretty-formatted". Only use this option for debugging only. --input-filestring- path to a JSON file to use as command input
--dry-run- validate all inputs and exit without performing any action (preview changes without applying them)
--json-
output as JSON