# Synonym search analyzer not updating after update synonyms.txt?

**URL:** <https://discuss.elastic.co/t/synonym-search-analyzer-not-updating-after-update-synonyms-txt/151637>\
**Category:** Elasticsearch\
**Created:** [October 9, 2018, 1:27pm UTC](https://discuss.elastic.co/t/synonym-search-analyzer-not-updating-after-update-synonyms-txt/151637 "2018-10-09T13:27:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmr317](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jmr317](https://discuss.elastic.co/u/jmr317)\
**Post date:** [October 9, 2018, 1:27pm UTC](https://discuss.elastic.co/t/synonym-search-analyzer-not-updating-after-update-synonyms-txt/151637/1 "2018-10-09T13:27:30Z")

</div>

So I have an index with the synonym mapping defined in the search analyzer. When I first created the index, the synonyms were picked up on search. After that, I updated the synonyms.txt files on the nodes once to update a synonym mapping and restarted each node after making a change. This caused the synonym change to be reflected on search thoughout the index.

Now, when I change the synonyms file and restart the nodes, the synonym mapping isn't updating as I believe it should. Am I missing something? I thought since the synonym mapping was on a search\_analyzer I wouldn't have to reindex each time to reflect the changes.

Here is my index definition:

> ```
> PUT /synonym_index
> {
> "aliases": {},
> "mappings": {
> "_doc": {
> "properties": {
> "name": {
> "type": "text",
> "fields": {
> "english": {
> "type": "text",
> "analyzer": "english",
> "search_analyzer":"english_and_synonyms"
> }
> }
> }
> }
> }
> },
> "settings": {
> "analysis": {
> "analyzer": {
> "english": {
> "tokenizer": "standard",
> "filter": [
> "english_possessive_stemmer",
> "lowercase",
> "english_stop",
> "english_keywords",
> "english_stemmer"
> ]
> },
> "english_and_synonyms": {
> "tokenizer": "standard",
> "filter": [
> "search_synonyms",
> "english_possessive_stemmer",
> "lowercase",
> "english_stop",
> "english_keywords",
> "english_stemmer"
> ]
> }
> },
> "filter": {
> "english_stop": {
> "type": "stop",
> "stopwords": "_english_" 
> },
> "english_keywords": {
> "type": "keyword_marker",
> "keywords": ["example"] 
> },
> "english_stemmer": {
> "type": "stemmer",
> "language": "english"
> },
> "english_possessive_stemmer": {
> "type": "stemmer",
> "language": "possessive_english"
> },
> "search_synonyms" : {
> "type" : "synonym_graph",
> "synonyms_path" : "analysis/synonyms.txt"
> }
> }
> },
> "index": {
> "number_of_shards": "5",
> "number_of_replicas": "1"
> }
> }
> }
> 
> ```

I've tried restarting the node with

> sudo service elasticsearch restart

and also with

> sudo service elasticsearch stop  
> sudo service elasticsearch start

but neither are causing my changes to reflect.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 6, 2018, 1:27pm UTC](https://discuss.elastic.co/t/synonym-search-analyzer-not-updating-after-update-synonyms-txt/151637/2 "2018-11-06T13:27:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
