reindex
Copy documents between Elasticsearch indexes, applying optional query filters, pipelines, or scripts to change field types, reshard, or migrate data. Runs asynchronously and returns a task ID for polling.
Instructions
Copy documents from a source index to a destination, optionally filtered by a query and transformed by a pipeline or script. Runs asynchronously (wait_for_completion=false) and returns a task_id to poll with get_task. Use this to change a field type, reshard, or migrate data. Requires writes enabled, ES_MCP_ALLOW_DESTRUCTIVE=true, and confirm=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| slices | No | auto | |
| confirm | No | ||
| op_type | No | index | |
| pipeline | No | ||
| dest_index | Yes | ||
| source_index | Yes | ||
| script_source | No | ||
| requests_per_second | No | ||
| wait_for_completion | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |