---
type: api
title: Mount a snapshot
description: Mount a snapshot as a searchable snapshot index.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-searchable-snapshots-mount
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-searchable-snapshots-mount
products:
  - Elasticsearch
---

# Mount a snapshot

Availability: 7.10+

## Paths

- `POST` `/_snapshot/{repository}/{snapshot}/_mount`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `repository` (string Name)
  The name of the repository containing the snapshot of the index to mount.
- `snapshot` (string Name)
  The name of the snapshot of the index to mount.

## Description

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.

## Required authorization

* Index privileges: `manage`
* Cluster privileges: `manage`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  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`.
- `wait_for_completion` (boolean · default: false)
  If true, the request blocks until the operation is complete.
- `storage` (string · default: full_copy)
  The mount option for the searchable snapshot index.

## Request Body

`application/json`

- `index` (string IndexName) — required
  The name of the index contained in the snapshot whose data is to be mounted.
If no `renamed_index` is specified, this name will also be used to create the new index.
- `renamed_index` (string IndexName) — optional
  The name of the index that will be created.
- `index_settings` (map string to object) — optional
  The settings that should be added to the index when it is mounted.
- `ignore_index_settings` ([] string) — optional
  The names of settings that should be removed from the index when it is mounted.

## Response

`application/json`

- `snapshot` ({} MountedSnapshot)
  - `snapshot` (string Name)
  - `indices` (string Indices)
  - `shards` ({} ShardStatistics)
    - `failed` (number uint)
      The number of shards the operation or search attempted to run on but failed.
    - `successful` (number uint)
      The number of shards the operation or search succeeded on.
    - `total` (number uint)
      The number of shards the operation or search will run on overall.
    - `failures` ([] ShardFailure)
      - `index` (string IndexName)
      - `node` (string)
      - `reason` ({} ErrorCause)
        - `type` (string)
          The type of error
        - `reason` (union string) — nullable
          A human-readable explanation of the error, in English.
          One of: `string`
        - `stack_trace` (string)
          The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
        - `caused_by` ({} ErrorCause) — recursive
          Same fields as `reason` in `failures`
        - `root_cause` ([] ErrorCause) — recursive
          Same fields as `reason` in `failures`
        - `suppressed` ([] ErrorCause) — recursive
          Same fields as `reason` in `failures`
      - `shard` (number)
      - `status` (string)
      - `primary` (boolean)
    - `skipped` (number uint)
## Code Examples

#### Console

```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" ]
}
```

#### JavaScript

```javascript
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"],
});
```

#### Python

```python
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"
    ],
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true" \
  -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"
    ]
  }'
```

#### Java

```java
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)
);
```

#### C#

```c#
var response = await client.SearchableSnapshots
    .MountAsync(repository: "my_repository", snapshot: "my_snapshot", d1 => d1
        .WaitForCompletion(true)
        .IgnoreIndexSettings("index.refresh_interval")
        .Index("my_docs")
        .IndexSettings(new Dictionary<string, object>()
        {
            { "index.number_of_replicas", 0 }
        })
        .RenamedIndex("docs")
    );
```

#### PHP

```php
$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",
        ),
    ],
]);
```

#### Ruby

```ruby
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"
    ]
  }
)
```

