2017-01-23 95 views
0

我正在尋找truncate類型。 我發現如何刪除管理客戶端的索引。 但我沒有找到任何方法來截斷Java API中的類型ElasticSearch - Java API - 截斷類型

+0

如果您使用的是ES 1.x,那麼您可以使用[刪除映射API](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete- ),否則這是ES [2.x以後的版本[不可能]](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/indices-delete-mapping.html)。 – Val

回答

0

如果您使用ES 1.x,則可以使用delete mapping API。 從ES 2.x起,這是not possible anymore

的原因是explained here

它不再能夠刪除類型映射(與該類型的文件一起)。即使刪除映射後,有關已刪除字段的信息仍然存在於Lucene級別,如果稍後添加相同名稱的字段,則可能導致索引損壞。