15

I'm new to Elasticsearch and I was wondering if it's possible to delete a custom analyzer or a custom filter from an index.

For example, imagine the following index settings:

    "settings" : {
        "analysis": {
            "filter":{
                "filter_metaphone":{
                    "encoder": "metaphone",
                    "type": "phonetic",
                    "replace": "false"
                },
                "filter_unused":{
                    "type": "edgeNGram",
                    "max_gram": "10",
                    "min_gram": "1" 
                }
            },
            "analyzer":{
                "name":{
                    "type": "custom",
                    "filter": ["filter_metaphone"],
                    "tokenizer": "standard"
                }
            }
        }   
    }

Is there any way to delete the filter "filter_unused" via curl without removing and creating the index with a new settings configuration?

3
  • what happens if you just re-post it without the filter_unused? Commented Nov 10, 2013 at 13:48
  • looking at the ES code I only see GET and POST methods in the REST analyze actions, no DELETE. Commented Nov 10, 2013 at 13:55
  • 1
    stackoverflow.com/questions/12367877/… Here you can see how to change analyzer settings of existing index. Commented Jul 9, 2015 at 15:40

2 Answers 2

4

After setting all values to null, the analyzer has disappeared for me (ES 6.8, 7.x, 8.x)

{
  "analysis": {
    "analyzer": {
      "my_search_analyzer" : {
        "filter" : null,
        "tokenizer" : null
      }
    }
  }
}

See Reset an index setting doc.

Sign up to request clarification or add additional context in comments.

2 Comments

This will not work anymore in ES 7.14. Setting to null will cause an exception.
@loretoparisi that is not correct; it still works on 7.x or 8.x; you may need to set the fields that are using this analyzer to use another one or null before resetting the analyzer. Think like deleting a row in a DB table where other table has with foreign keys linked to this row...
1

No, there is not a way to delete one specific analyzer from an index setting at this time.

You could add new analyzers though. That API is documented here.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html#indices-update-settings

1 Comment

looks like for ES5.x.x this has been solved with elastic.co/guide/en/elasticsearch/reference/current/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.