Mount a snapshot
Generally available; Added in 7.10.0
Mount a snapshot as a searchable snapshot index. Do not use this API for snapshots managed by index lifecycle management (ILM). Manually mounting ILM-managed snapshots can interfere with ILM processes.
highlight#highlightFromAnchor" href="#topic-required-authorization"> Required authorization
- Index privileges:
manage
- Cluster privileges:
manage
Path parameters
-
The name of the repository containing the snapshot of the index to mount.
-
The name of the snapshot of the index to mount.
Query parameters
-
The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to
-1
.Values are
-1
or0
. -
If true, the request blocks until the operation is complete.
-
The mount option for the searchable snapshot index.
POST
/_snapshot/{repository}/{snapshot}/_mount
dropdown#toggle click@window->dropdown#hide touchend@window->dropdown#hide"
data-dropdown-target="button"
data-scrollable="false"
data-headings="false"
aria-expanded="false"
aria-haspopup="true"
role="menu"
tabindex="0">
Console
POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "my_docs",
"renamed_index": "docs",
"index_settings": {
"index.number_of_replicas": 0
},
"ignore_index_settings": [ "index.refresh_interval" ]
}
resp = client.searchable_snapshots.mount(
repository="my_repository",
snapshot="my_snapshot",
wait_for_completion=True,
index="my_docs",
renamed_index="docs",
index_settings={
"index.number_of_replicas": 0
},
ignore_index_settings=[
"index.refresh_interval"
],
)
const response = await client.searchableSnapshots.mount({
repository: "my_repository",
snapshot: "my_snapshot",
wait_for_completion: "true",
index: "my_docs",
renamed_index: "docs",
index_settings: {
"index.number_of_replicas": 0,
},
ignore_index_settings: ["index.refresh_interval"],
});
response = client.searchable_snapshots.mount(
repository: "my_repository",
snapshot: "my_snapshot",
wait_for_completion: "true",
body: {
"index": "my_docs",
"renamed_index": "docs",
"index_settings": {
"index.number_of_replicas": 0
},
"ignore_index_settings": [
"index.refresh_interval"
]
}
)
$resp = $client->searchableSnapshots()->mount([
"repository" => "my_repository",
"snapshot" => "my_snapshot",
"wait_for_completion" => "true",
"body" => [
"index" => "my_docs",
"renamed_index" => "docs",
"index_settings" => [
"index.number_of_replicas" => 0,
],
"ignore_index_settings" => array(
"index.refresh_interval",
),
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"index":"my_docs","renamed_index":"docs","index_settings":{"index.number_of_replicas":0},"ignore_index_settings":["index.refresh_interval"]}' "$ELASTICSEARCH_URL/_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true"
client.searchableSnapshots().mount(m -> m
.ignoreIndexSettings("index.refresh_interval")
.index("my_docs")
.indexSettings("index.number_of_replicas", JsonData.fromJson("0"))
.renamedIndex("docs")
.repository("my_repository")
.snapshot("my_snapshot")
.waitForCompletion(true)
);
Request example
Run `POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true` to mount the index `my_docs` from an existing snapshot named `my_snapshot` stored in `my_repository` as a new index `docs`.
{
"index": "my_docs",
"renamed_index": "docs",
"index_settings": {
"index.number_of_replicas": 0
},
"ignore_index_settings": [ "index.refresh_interval" ]
}