How to Delete (Hard Delete) document from Elasticsearch Disk?

Hi,

I am trying to delete a document from elastic search (using .Net NEST library), but a document is not deleted from a segment, just marked as deleted. (does not free the disk space.)

Could you please let us know how to delete a document from elastic search disk and in other words how to free the disk space.

Thanks in advance.

Regards
Harshal

Perform the delete and then run a force merge with max_num_segments set to 1 or the only_expunge_deletes parameter. Be aware that this is an expensive operation in terms of processing and disk I/O.

I have deleted the existing all index and document and now i want to free the space from Elastic search, Please let me know how i can.

Thank you!, I will try above fix.

Could you please help us here, i have tried below

POST /kimchy/_forcemerge?only_expunge_deletes=false&max_num_segments=100&flush=true

but no luck.

That is not what I recommended. Try POST /indexname/_forcemerge?max_num_segments=1&flush=true or POST /indexname/_forcemerge?only_expunge_deletes=true.

Be aware it is an expensive operation and can take some time to run.

Thanks for quick response, let me try,

If i have already deleted the index in that case what I will do.

if you have deleted the index, you will not be able to run a force merge on i.

Could you please let me know so how i can free the disk space for same.

Thanks again for response.

If you have deleted the index the disk space has been freed, hasn’t it? I am not sure I understand the question.

Hi Christian,

I am using Cerebro tool (Please see below screen 1)
Note: In below screen there is no any index exist, still showing the disk utilization.

For reference (Screen 2)

Please guide me how i can free up the disk space.

Thank You!

Regards
Harshal Chaudhari

When Elasticsearch deletes an index the data files are removed. If you log into the box, what is taking up space? How large was the index you deleted?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.