---
type: api
title: Reload search analyzers
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-indices-reload-search-analyzers
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-indices-reload-search-analyzers
products:
  - Elasticsearch
---

# Reload search analyzers


Availability: Generally available since 7.3

## Paths

- `POST` (also `GET`) `/{index}/_reload_search_analyzers`

#### Path parameters

- `index` (union string | string[]) — required
  A comma-separated list of index names to reload analyzers for

## Description

Reload an index's search analyzers and their resources.
For data streams, the API reloads search analyzers and resources for the stream's backing indices.

IMPORTANT: After reloading the search analyzers you should clear the request cache to make sure it doesn't contain responses derived from the previous versions of the analyzer.

You can use the reload search analyzers API to pick up changes to synonym files used in the `synonym_graph` or `synonym` token filter of a search analyzer.
To be eligible, the token filter must have an `updateable` flag of `true` and only be used in search analyzers.

NOTE: This API does not perform a reload for each shard of an index.
Instead, it performs a reload for each node containing index shards.
As a result, the total shard count returned by the API can differ from the number of index shards.
Because reloading affects every node with an index shard, it is important to update the synonym file on every data node in the cluster--including nodes that don't contain a shard replica--before using this API.
This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.

[More about the search_analyzer](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/search-analyzer)

## Required authorization

- Index 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

- `allow_no_indices` (boolean) — optional
  A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.
- `expand_wildcards` (string · default: open) — optional
  Whether to expand wildcard expression to concrete indices that are open, closed or both.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
  Values: `all`, `open`, `closed`, `hidden`, `none`
- `ignore_unavailable` (boolean) — optional
  If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.
- `resource` (string) — optional
  Changed resource to reload analyzers from if applicable

## Response

`application/json`

- `reload_details` (object[])
  - `index` (string)
  - `reloaded_analyzers` (string[])
  - `reloaded_node_ids` (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 /my-index-000001/_reload_search_analyzers
```

#### JavaScript

```javascript
const response = await client.indices.reloadSearchAnalyzers({
  index: "my-index-000001",
});
```

#### Python

```python
resp = client.indices.reload_search_analyzers(
    index="my-index-000001",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/my-index-000001/_reload_search_analyzers" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.indices().reloadSearchAnalyzers(r -> r
    .index("my-index-000001")
);
```

#### C#

```c#
var response = await client.Indices.ReloadSearchAnalyzersAsync(indices: new[] { "my-index-000001" });
```

#### PHP

```php
$resp = $client->indices()->reloadSearchAnalyzers([
    "index" => "my-index-000001",
]);
```

#### Ruby

```ruby
response = client.indices.reload_search_analyzers(
  index: "my-index-000001"
)
```

## Response examples

#### Reload search analyzers response example1

A successful response when reloading a search analyzer of an index.

```json
{
  "template": {
    "settings": {
      "number_of_shards": 1
    },
    "mappings": {
      "_source": {
        "enabled": false
      },
      "properties": {
        "host_name": {
          "type": "keyword"
        },
        "created_at": {
          "type": "date",
          "format": "EEE MMM dd HH:mm:ss Z yyyy"
        }
      }
    }
  }
}
```

