easthome001 发表于 2017-11-7 14:40 是的。调用forcemerge也不是真正的删除,而是重新创建了不包含已删除的doc的segments。 [mw_shl_code=html,true]In Lucene, a document is not deleted from a segment, just marked as deleted. During a merge process of segments, a new segment is created that does not have those deletes.[/mw_shl_code] |
erbin 发表于 2017-11-7 14:11 那就是它只是改变了里面的标记,并未真正删除。 |
找到答案了,es删除索引后只是把索引标记为已删除,需要手动执行forcemerge才会真正的删除掉。 https://stackoverflow.com/questions/20608417/elasticsearch-how-to-free-store-size-after-deleting-documentshttps://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-forcemerge.html [mw_shl_code=shell,true]curl -XPOST 'http://localhost:9200/searchrecord/_forcemerge?only_expunge_deletes=true'[/mw_shl_code] |