Applying best compression on already force-merged indices

Hi All,

Have a question related to applying best_compression on indices that are already force-merged to 1 segment.

My question is: Can i still apply best_compression on them to save some disk space?

I suppose I can close, apply b_c and then open them.

While this post says that this should work, another post says in order for b_c to be effected, they need to be force-merged. Since my indices are already force-merged, I'm doubtful if applying b_c will have any benefits?

Can someone clarify please.

Thanks.

As segments are immutable I do believe you will need to forcemerge again. If you are already down to a single segment I suspect this would be a no-op, so you may need to add a dummy document that you then delete in order to create another segment.

Thanks Christian, as always, for being so helpful. A question: The recommendation is to never write to force-merged indices since force-merging is done only on RO indices. Or that we can write at times? I remember doing exactly what you mentioned a while back but not sure if this is recommended.

This is correct as it removes some of the benefits of forcemerging. Normally you should apply best_compression before forcemerging, so the approach I provided is merely a workaround in order to get the best_compression to apply.

1 Like

Thanks Christian. That clarifies.

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