﻿---
title: max_num_segments option
description: The value for this setting is the cutoff number of segments per shard.  Indices which have more than this number of segments per shard will remain in...
url: https://www.elastic.co/elastic/docs-builder/docs/2907/reference/elasticsearch/curator/option_mns
products:
  - Elasticsearch
  - Elasticsearch Curator
---

# max_num_segments option
<note>
  This setting is required when using the [forceMerge action](https://www.elastic.co/elastic/docs-builder/docs/2907/reference/elasticsearch/curator/forcemerge).
</note>

```yaml
action: forcemerge
description: >-
  Perform a forceMerge on selected indices to 'max_num_segments' per shard
options:
  max_num_segments: 2
  timeout_override: 21600
filters:
- filtertype: ...
```

The value for this setting is the cutoff number of segments per shard.  Indices which have more than this number of segments per shard will remain in the index list.
There is no default value. This setting must be set by the user or an exception will be raised, and execution will halt.