esasticSearch2.0中,mapping不再支持删除,官方文档中原话是:This is no longer supported, because remnants of the fields in the type could remain in the index, causing corruption later on
这个要怎么理解,,删就删了,怎么会有数据残留呢?大家怎么处理类型删除的需求的。
这个要怎么理解,,删就删了,怎么会有数据残留呢?大家怎么处理类型删除的需求的。
2 个回复
medcl - 今晚打老虎。
赞同来自:
https://www.elastic.co/guide/e ... leted
因为底层的Lucene其实没有type的概念,都是在一个lucene的库里面,里面有很多各种后缀的文件,相关的信息其实已经产生了,之前的删除type其实不是安全的,所以这个版本限制了这种用法。
redhat
赞同来自:
Types may no longer be deletededit
In 1.x it was possible to delete a type mapping, along with all of the documents of that type, using the delete mapping API. This is no longer supported, because remnants of the fields in the type could remain in the index, causing corruption later on.
Instead, if you need to delete a type mapping, you should reindex to a new index which does not contain the mapping. If you just need to delete the documents that belong to that type, then use the delete-by-query plugin instead.