Skip to content
Draft
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions docs/reference/option_number_of_shards.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_number_of_shards.html
applies_to:
stack: both
serverless: unavailable
products:
- id: elasticsearch
---

# number_of_shards [option_number_of_shards]

The `number_of_shards` option specifies the number of primary shards in the target index created by the shrink action.

::::{note}
This setting is only used by the [shrink](/reference/shrink.md) action.
`number_of_shards` is used only by the [shrink](/reference/shrink.md) action.
::::

* **Type:** Integer
* **Required:** Optional
* **Required:** Optional

The value of `number_of_shards` determines the number of primary shards in the target index after the shrink operation.

::::{important}
The value of `number_of_shards` must meet the following criteria:
* It must be lower than the number of primary shards in the source index.
* It must be a factor of the number of primary shards in the source index.

For example, a source index with 8 primary shards can be shrunk to 4, 2, or 1, and cannot be shrunk to 3 or 5.
::::

```yaml
action: shrink
description: >-
Expand All @@ -22,14 +42,10 @@
- filtertype: ...
```
The value of this setting determines the number of primary shards in the target index. The default value is `1`.

::::{important}
The value for `number_of_shards` must meet the following criteria:
Before you use `number_of_shards`, learn about shards and how shard count and sizing affect performance and scalability. For details, check the following:

* It must be lower than the number of primary shards in the source index.
* It must be a factor of the number of primary shards in the source index.
* [Clusters, nodes, and shards](docs-content://deploy-manage/distributed-architecture/clusters-nodes-shards.md)
* [Size your shards](docs-content://deploy-manage/production-guidance/optimize-performance/size-shards.md)

::::


Loading