Forcemerge?max_num_segments=1 is having any side affect to es engine

Hi,
I have used curl -XPOST localhost:9200/myindex/_forcemerge?max_num_segments=1 , after hit this API i have checked segments with this API curl localhost:9200/myindex/_segments?pretty and find that segment is reduced to 1. My question is that is any side effect in es engine due to segments reduced to 1, where as default segment is more. what is best practice to remove deleted documents.

No side effects as such for the index.

The merge process may have some effect. It takes non-trivial CPU resources to merge segments of a large shard to a single segment. If shard size is 50GB you need additional 60-70 GB space. If this crosses your disk watermark on the node other shards may move.

Generally let ES/Lucene handle segment merges while data is being written to the index. With time based indices after certain time you stop writing to the index and create new index for writing. At this time you can forcemerge the old index. In my experience it reduces index size by 10+% and you need less system resources like file handles.

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