删除带有文档的现有索引上的索引过滤器设置



我已经在我的Elasticsearch Server上创建了一个具有以下设置的索引:

PUT /myindex
{
    "settings": {
        "number_of_replicas": 0,
        "analysis": {
            "analyzer": {
                "default": {
                    "tokenizer": "standard",
                    "filter":  [ "lowercase", "asciifolding" ]
                }
            }
        }
    }
}

添加了大量文档后,我使用以下请求更新了索引设置:

PUT /myindex/_settings
{
    "settings": {
        "analysis": {
            "analyzer": {
                "default": {
                    "tokenizer": "standard",
                    "filter":  [ "asciifolding" ]
                }
            }
        }
    }    
}

并删除了索引lowercase过滤器,但是看来我在该索引上的所有文档似乎仍使用lowercase过滤索引。我是否应该重新索引我的所有文档( sigh ),还是有任何方法告诉Elasticsearch考虑考虑我的新过滤器设置的所有文档?

您需要重新索引,基本上是Lucene索引段是不可变的。如果您有新的ES版本,则此API将为您提供帮助:https://www.elastic.co/guide/en/elasticsearch/reference/referent/current/current/docs-reindex.html,否则您必须使用search& scroll&hamp;从原始来源

最新更新