ElasticSearch删除自定义分析器/过滤器

w8rqjzmb  于 2022-11-22  发布在  ElasticSearch
关注(0)|答案(2)|浏览(186)

我是Elasticsearch的新手,我想知道是否可以从索引中删除自定义分析器或自定义过滤器。
例如,假设有下列索引设定:

"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"
                }
            }
        }   
    }

有没有办法通过curl删除过滤器**“filter_unused”**,而不删除并使用新的设置配置创建索引?

t1qtbnec

t1qtbnec1#

将所有值设置为空后,分析仪对我来说已消失(ES 6.8、7.x、8.x)

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

请参阅重设索引设定文件。

xam8gpfp

xam8gpfp2#

否,目前无法从索引设置中删除特定分析仪。
不过,您可以添加新的分析器。
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html#indices-update-settings

相关问题