Reindex legacy backing indices
Technical preview; Added in 8.18.0
Reindex all legacy backing indices for a data stream. This operation occurs in a persistent task. The persistent task ID is returned immediately and the reindexing work is completed in that task.
POST
/_migration/reindex
Console
POST _migration/reindex
{
"source": {
"index": "my-data-stream"
},
"mode": "upgrade"
}
resp = client.perform_request(
"POST",
"/_migration/reindex",
headers={"Content-Type": "application/json"},
body={
"source": {
"index": "my-data-stream"
},
"mode": "upgrade"
},
)
const response = await client.transport.request({
method: "POST",
path: "/_migration/reindex",
body: {
source: {
index: "my-data-stream",
},
mode: "upgrade",
},
});
response = client.perform_request(
"POST",
"/_migration/reindex",
{},
{
"source": {
"index": "my-data-stream"
},
"mode": "upgrade"
},
{ "Content-Type": "application/json" },
)
$requestFactory = Psr17FactoryDiscovery::findRequestFactory();
$streamFactory = Psr17FactoryDiscovery::findStreamFactory();
$request = $requestFactory->createRequest(
"POST",
"/_migration/reindex",
);
$request = $request->withHeader("Content-Type", "application/json");
$request = $request->withBody($streamFactory->createStream(
json_encode([
"source" => [
"index" => "my-data-stream",
],
"mode" => "upgrade",
]),
));
$resp = $client->sendRequest($request);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"source":{"index":"my-data-stream"},"mode":"upgrade"}' "$ELASTICSEARCH_URL/_migration/reindex"
Request example
An example body for a `POST _migration/reindex` request.
{
"source": {
"index": "my-data-stream"
},
"mode": "upgrade"
}