From 806bee892c08a1b6b65ca9350019e5acb8acc45a Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Wed, 17 Sep 2025 12:23:11 -0500 Subject: [PATCH 1/5] [DOCS] Improve number_of_shards option page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated documentation for the number_of_shards option, clarifying its purpose and criteria for usage. Changes include: - Moved description to top - Explicitly stated type, default, and whether it’s optional. - Added links to shards intro and shard sizing guidance to help with assumed knowledge. - Clarified scope: relevant to cloud/on-prem, not serverless. --- docs/reference/option_number_of_shards.md | 32 +++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/reference/option_number_of_shards.md b/docs/reference/option_number_of_shards.md index c804fba4..34c614b6 100644 --- a/docs/reference/option_number_of_shards.md +++ b/docs/reference/option_number_of_shards.md @@ -1,15 +1,35 @@ --- mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_number_of_shards.html +applies_to: + stack: + 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 +* **Default value:** 1 +* **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: >- @@ -22,14 +42,10 @@ filters: - 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) -:::: From f302f0423f13c79f7fdbdc482bc7f1c2e0d10a24 Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Wed, 17 Sep 2025 12:29:57 -0500 Subject: [PATCH 2/5] Update docs/reference/option_number_of_shards.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/reference/option_number_of_shards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/option_number_of_shards.md b/docs/reference/option_number_of_shards.md index 34c614b6..a8103bfb 100644 --- a/docs/reference/option_number_of_shards.md +++ b/docs/reference/option_number_of_shards.md @@ -2,7 +2,7 @@ mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_number_of_shards.html applies_to: - stack: + stack: both serverless: unavailable products: - id: elasticsearch From bddf7762cca3e00cae615537fbb486967e13c1ce Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Wed, 17 Sep 2025 12:30:06 -0500 Subject: [PATCH 3/5] Update docs/reference/option_number_of_shards.md --- docs/reference/option_number_of_shards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/option_number_of_shards.md b/docs/reference/option_number_of_shards.md index a8103bfb..1cdab579 100644 --- a/docs/reference/option_number_of_shards.md +++ b/docs/reference/option_number_of_shards.md @@ -10,7 +10,7 @@ products: # 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. +The `number_of_shards` option specifies the number of primary shards in the target index created by the shrink action. ::::{note} `number_of_shards` is used only by the [shrink](/reference/shrink.md) action. From 5cfb4b49700a5aeb4f8b1184156e395fd25b5e1d Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Wed, 17 Sep 2025 12:30:12 -0500 Subject: [PATCH 4/5] Update docs/reference/option_number_of_shards.md --- docs/reference/option_number_of_shards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/option_number_of_shards.md b/docs/reference/option_number_of_shards.md index 1cdab579..f19ea593 100644 --- a/docs/reference/option_number_of_shards.md +++ b/docs/reference/option_number_of_shards.md @@ -17,7 +17,7 @@ The `number_of_shards` option specifies the number of primary shards in the targ :::: * **Type:** Integer -* **Default value:** 1 +* **Required:** Optional * **Required:** Optional The value of `number_of_shards` determines the number of primary shards in the target index after the shrink operation. From 09bf2adad5ad4a541e8764fa5bbd7c9e65c109b8 Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Wed, 17 Sep 2025 12:31:15 -0500 Subject: [PATCH 5/5] Update docs/reference/option_number_of_shards.md --- docs/reference/option_number_of_shards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/option_number_of_shards.md b/docs/reference/option_number_of_shards.md index f19ea593..2ed86695 100644 --- a/docs/reference/option_number_of_shards.md +++ b/docs/reference/option_number_of_shards.md @@ -29,7 +29,7 @@ The value of `number_of_shards` must meet the following criteria: 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. :::: - + ## number_of_shards example [option-number-of-shards-example] ```yaml action: shrink description: >-