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

# Mount a snapshot

Availability: Generally available since 7.10

## Paths

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

#### Path parameters

- `repository` (string) — required
  The name of the repository containing the snapshot of the index to mount.
- `snapshot` (string) — required
  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`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  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) — optional
  If true, the request blocks until the operation is complete.
- `storage` (enum · default: full_copy) — optional
  The mount option for the searchable snapshot index.
For further information on mount options, refer to: [Mount options](https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots#searchable-snapshot-mount-storage-options)

Supported values include:
  - `full_copy`: Fully caches the snapshotted index’s shards in the Elasticsearch cluster.
  - `shared_cache`: Uses a local cache containing only recently searched parts of the snapshotted index’s data.
  Values: `full_copy`, `shared_cache`

## Request body

`application/json`

- `index` (string) — 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) — 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` (object)
  - `snapshot` (string)
  - `indices` (string)
  - `shards` (object)
    - `failed` (number)
      The number of shards the operation or search attempted to run on but failed.
    - `successful` (number)
      The number of shards the operation or search succeeded on.
    - `total` (number)
      The number of shards the operation or search will run on overall.
    - `failures` (object[])
      - `index` (string)
      - `node` (string)
      - `reason` (object)
        - `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` (object) — recursive
          Same fields as `reason` in `failures`
        - `root_cause` (object[]) — recursive
          Same fields as `reason` in `failures`
        - `suppressed` (object[]) — recursive
          Same fields as `reason` in `failures`
      - `shard` (number)
      - `status` (string)
      - `primary` (boolean)
    - `skipped` (number)
## 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"
    ]
  }
)
```

