Forcemerge API max_num_segments=1 ok for my index?

I have index (myindex) in cluster with two nodes, i am deleting some records with delete_by_query. Now i want to use
curl -XPOST 192.168.1.111:9200/myindex/_forcemerge?max_num_segments=1 to free disk space and mke lighter. so max_num_segments=1 is ok or anything else
i should do care.
How this API is different from _forcemerge?only_expunge_deletes=true
Which one will be better and faster?

Force merge is recommended only to be run in read-only indices:

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html

If you still want to run it to free space I would recommend to run it with only_expunge_deletes=true if your segment are not read-only as it will be faster and it will only merge segments with delete documents.

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