elasticsearch-reindex
Guide Elasticsearch reindex for performance: local and remote, slicing, throttling, task API. Use when copying or migrating indices, changing mappings, or…
от elastic★ 615 звёзд на GitHub
Установить elasticsearch-reindex в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Elasticsearch Reindex
Copy documents from source indices or data streams to a destination using POST /_reindex. An expert reindex workflow
prepares the destination explicitly, chooses local versus remote execution, filters at the source when only a subset is
needed, runs long copies asynchronously, tracks the task to completion, and verifies the destination document count
before reporting results.
Environment Configuration
This skill executes Elasticsearch operations through the elastic CLI. If the
elastic CLI is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.
This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping,
GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document
maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API
directly.
Process
Confirm connectivity and deployment type. Call
GET /. Readbuild_flavorandversion.numberto know whether shard, replica, and cluster-settings APIs are available (Serverless manages shards/replicas internally and blocks most_cluster/*APIs). The decision: continue only when the cluster is reachable. If the call fails, stop — do not guess endpoints or credentials.Decide local versus remote reindex. Compare where the source and destination live.
- Same cluster — use local reindex:
source.indexanddest.indexonly. Do not addsource.remotewhen both indices are on the cluster you are connected to. - Different cluster — use reindex from remote: add
source.remotewith the remote cluster URL and credentials. Remote reindex does not support slicing; compensate with query-based partitioning (date ranges, term filters) across parallel requests. Confirm the remote host is allowlisted on Self-Managed / ECH (reindex.remote.whitelistin cluster config); Serverless manages allowlisting internally (ECH remotes only, Tech Preview).
Data needed: source index name(s), destination index name, and whether they share a cluster.
- Same cluster — use local reindex:
Inspect the source — never guess field names or counts. Call
GET /{source}/_mappingto ground field names and types. CallGET /{source}/_count(orGET /_cat/count/{source}?h=counton Self-Managed / ECH) to learn how many documents exist.The decision: full copy versus filtered subset.
- Full copy — omit
source.query(match-all behavior). - Filtered subset — add
source.querywith Query DSL. For time ranges, use arangefilter on the timestamp field (commonly@timestamp), e.g."gte": "2025-01-01", "lt": "2025-02-01"for January 2025. Do not run a full-index copy when the user asked for a date range or other filter.
Data needed: the user's filter criteria and the mapping-confirmed field names.
- Full copy — omit
Prepare the destination index before copying.
_reindexdoes not copy mappings, shard counts, or analyzers. Create the destination with explicit settings and mappings derived from the source mapping viaPUT /{dest}.- On Self-Managed / ECH: set
number_of_replicas: 0andrefresh_interval: "-1"on the destination during the copy for write throughput; restore production values afterward withPUT /{dest}/_settings. - On Serverless: omit
number_of_shardsandnumber_of_replicas(managed by Elastic); you may setrefresh_interval: "-1"during the copy. - For data stream destinations: ensure an index template with
data_stream: {}exists, create the data stream, and setdest.op_typeto"create"(append-only).
The decision: create/prepare the target rather than relying on auto-creation with dynamic mapping. Wrong or missing mappings cause partial failures or silent type coercion.
Data needed: destination name, corrected or compatible mappings, and deployment-specific settings constraints.
- On Self-Managed / ECH: set
Build and submit the reindex request. Call
POST /_reindex?wait_for_completion=falsefor any copy that may take more than a few seconds or when the user says the index is large — the response returns a task id immediately instead of blocking.Request body essentials:
source.index— source index or data stream (correct name, not reversed withdest.index).dest.index— prepared destination from step 4.source.query— include only when step 3 chose a filtered subset.conflicts: "proceed"— when retrying a partially complete reindex.- Optional tuning:
source.size(batch size),requests_per_second(throttle),slices=autoon local reindex only (parallelize per primary shard — never for remote),scroll(increase keep-alive o
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/api-reference.md
- references/patterns.md
- references/troubleshooting.md
- references/tuning.md
FAQ
Что делает скилл elasticsearch-reindex?
Guide Elasticsearch reindex for performance: local and remote, slicing, throttling, task API. Use when copying or migrating indices, changing mappings, or transforming during reindex.
Как установить скилл elasticsearch-reindex?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл elasticsearch-reindex запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…