Create an index from a source index Technical preview; Added in 8.18.0
All methods and paths for this operation:
PUT /_create_from/{source}/{dest}
POST /_create_from/{source}/{dest}
Copy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values.
Body Required
-
Index settings -
If index blocks should be removed when creating destination index (optional)
Default value is
true
.
POST /_create_from/{source}/{dest}
Console
POST _create_from/my-index/my-new-index
resp = client.perform_request( "POST", "/_create_from/my-index/my-new-index", )
const response = await client.transport.request({ method: "POST", path: "/_create_from/my-index/my-new-index", });
response = client.perform_request( "POST", "/_create_from/my-index/my-new-index", {}, )
$requestFactory = Psr17FactoryDiscovery::findRequestFactory(); $request = $requestFactory->createRequest( "POST", "/_create_from/my-index/my-new-index", ); $resp = $client->sendRequest($request);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_create_from/my-index/my-new-index"
client.indices().createFrom(c -> c .dest("my-new-index") .source("my-index") .createFrom(cr -> cr) );