opensearch-docs-cn/_im-plugin/refresh-analyzer/index.md

40 lines
833 B
Markdown
Raw Normal View History

2021-05-28 13:48:19 -04:00
---
layout: default
2021-06-10 01:18:31 -04:00
title: Refresh search analyzer
2021-09-15 16:47:04 -04:00
nav_order: 50
2021-05-28 13:48:19 -04:00
has_children: false
2021-08-12 17:34:31 -04:00
redirect_from: /im-plugin/refresh-analyzer/
2021-05-28 13:48:19 -04:00
has_toc: false
---
# Refresh search analyzer
With ISM installed, you can refresh search analyzers in real time with the following API:
```json
POST /_plugins/_refresh_search_analyzers/<index or alias or wildcard>
```
For example, if you change the synonym list in your analyzer, the change takes effect without you needing to close and reopen the index.
To work, the token filter must have an `updateable` flag of `true`:
```json
{
"analyzer": {
"my_synonyms": {
"tokenizer": "whitespace",
"filter": [
"synonym"
]
}
},
"filter": {
"synonym": {
"type": "synonym_graph",
"synonyms_path": "synonyms.txt",
"updateable": true
}
}
}
```