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

# Reload search analyzers


Availability: 7.3+

## Paths

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

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

- `index` (union IndexName | [] IndexName)
  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.

## Required authorization

* Index privileges: `manage`

[Read the reference documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-analyzer.html)

## Query String Parameters

- `allow_no_indices` (boolean)
  Whether to ignore if a wildcard indices expression resolves into no concrete indices.
(This includes `_all` string or when no indices have been specified)
- `expand_wildcards` (string ExpandWildcards · default: open)
  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)
  Whether specified concrete indices should be ignored when unavailable (missing or closed)
- `resource` (string)
  Changed resource to reload analyzers from if applicable

## Response

`application/json`

- `reload_details` ([] ReloadDetails)
  - `index` (string)
  - `reloaded_analyzers` ([] string)
  - `reloaded_node_ids` ([] string)
- `_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 /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"
```

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

