Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elasticsearch remove custom analyzer / filter

I'm new to elastic search 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 via curl the filter "filter_unused" without remove and create the index with a new settings configuration?

like image 834
user2970458 Avatar asked Nov 08 '13 20:11

user2970458


2 Answers

after setting all values to null, the analyzer has disappeared for me (ES 6.8)

{
  "analysis": {
    "analyzer": {
      "my_search_analyzer" : {
        "filter" : null,
        "tokenizer" : null
      }
    }
  }
}
like image 63
Oleg Skrypnyuk Avatar answered Nov 05 '22 06:11

Oleg Skrypnyuk


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

like image 21
Andy Avatar answered Nov 05 '22 08:11

Andy