# How to fix(remove) a "bad" index settings update?

**URL:** <https://discuss.elastic.co/t/how-to-fix-remove-a-bad-index-settings-update/942>\
**Category:** Elasticsearch\
**Created:** [May 20, 2015, 7:13am UTC](https://discuss.elastic.co/t/how-to-fix-remove-a-bad-index-settings-update/942 "2015-05-20T07:13:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaraju](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@yaraju](https://discuss.elastic.co/u/yaraju)\
**Post date:** [May 20, 2015, 7:13am UTC](https://discuss.elastic.co/t/how-to-fix-remove-a-bad-index-settings-update/942/1 "2015-05-20T07:13:59Z")

</div>

I made an "Index \_settings update" by doing the following:

1. POST to /index/\_close
2. PUT to /index/\_settings
3. POST to /index/\_open

The server gave me an "error" in the log since the format was wrong - but it also saved the update, thereby corrupting the index settings in an "irreversible" way.

The only option at this point would be - create new index, fix existing index setting until we can "open" it again, and then bulk api copy it to a new index.

Are there ways for "recovering' from the situation other than recreating the index? (Especially if the said analyzers are not yet in use?)

P.S. Purpose is to learn - since in this case, i have mostly test data where losing is a pain - but not end of the world. Doing this on production would be bad!

**Details follow:**

Settings update:

```
{
  "analysis": {
    "filter": {
      "synonym": {
        "type": "synonym",
        "format": "wordnet",
        "synonyms_path": "analysis/wn_s.pl"
      },
      "ascii_folding": {
        "type": "asciifolding"
      },
    "analyzer": {
      "fulltext_analyzer": {
        "type": "custom",
        "tokenizer": "standard",
        "filter": [
          "lowercase",
          "word_delimiter",
          "synonym"
        ]
      }
    }
    }
  }
}

```

So far so good. But on closer look, I messed up - I added "analyzer" under "filter".  
And the error was:

```
 org.elasticsearch.ElasticsearchIllegalArgumentException: token filter [analyzer] must have a type associated with it

```

But the problem is - now I can't 'remove' the entry of 'analyzer'. my only option is to add 'type: standard' and live with the corrupted setting in the index.

The following would have helped avoid the situation:

- The [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html) could warn that most "settings API updates" are irreversible (You can only "add" a new dictionary but never remove - even new fields would only "merge the fields" with existing fields)
- With server-side validation of the JSON - or just not save if the  
settings API had an 'error'

---

<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:** [July 6, 2017, 12:13am UTC](https://discuss.elastic.co/t/how-to-fix-remove-a-bad-index-settings-update/942/2 "2017-07-06T00:13:13Z")

</div>


