Force merge

Phases allowed: hot, warm.

Force merges the index into the specified maximum number of segments.

This action makes the index read-only.

To use the forcemerge action in the hot phase, the rollover action must be present. If no rollover action is configured, ILM will reject the policy.

Options

max_num_segments

(Required, integer) Number of segments to merge to. To fully merge the index, set to 1.

index_codec

(Optional, string) Codec used to compress the document store. The only accepted value is best_compression, which uses DEFLATE for a higher compression ratio but slower stored fields performance. To use the default LZ4 codec, omit this argument.

If using best_compression, ILM will close and then re-open the index prior to the force merge. While closed, the index will be unavailable for read or write operations.

Example

  1. PUT _ilm/policy/my_policy
  2. {
  3. "policy": {
  4. "phases": {
  5. "warm": {
  6. "actions": {
  7. "forcemerge" : {
  8. "max_num_segments": 1
  9. }
  10. }
  11. }
  12. }
  13. }
  14. }