From 51499aeac1d238519c6354a83c570e29359753ed Mon Sep 17 00:00:00 2001 From: Oleg Kravchuk Date: Thu, 1 Feb 2024 21:03:38 +0200 Subject: [PATCH] [DOC] Support switch_aliases in shrink action. (#5511) * Support switch_aliases in shrink action DOC. Signed-off-by: ikibo * Update _im-plugin/ism/policies.md Co-authored-by: Heather Halter Signed-off-by: Oleg Kravchuk * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Oleg Kravchuk * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Oleg Kravchuk * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Oleg Kravchuk * Data types in TYPE column must be capitalized Signed-off-by: ikibo * Update policies.md Added tick marks to two parameters Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter * Update _im-plugin/ism/policies.md Co-authored-by: Melissa Vagi Signed-off-by: Heather Halter --------- Signed-off-by: ikibo Signed-off-by: Oleg Kravchuk Signed-off-by: Heather Halter Co-authored-by: ikibo Co-authored-by: Heather Halter Co-authored-by: Melissa Vagi --- _im-plugin/ism/policies.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/_im-plugin/ism/policies.md b/_im-plugin/ism/policies.md index 2b9ec15a..e6262e88 100644 --- a/_im-plugin/ism/policies.md +++ b/_im-plugin/ism/policies.md @@ -119,8 +119,8 @@ Reduces the number of Lucene segments by merging the segments of individual shar Parameter | Description | Type | Required :--- | :--- |:--- |:--- | `max_num_segments` | The number of segments to reduce the shard to. | `number` | Yes -wait_for_completion | Boolean | When set to `false`, the request returns immediately instead of after the operation is finished. To monitor the operation status, use the [Tasks API]({{site.url}}{{site.baseurl}}/api-reference/tasks/) with the task ID returned by the request. Default is `true`. -task_execution_timeout | Time | The explicit task execution timeout. Only useful when wait_for_completion is set to `false`. Default is `1h`. | No +`wait_for_completion` | Boolean | When set to `false`, the request returns immediately instead of after the operation is finished. To monitor the operation status, use the [Tasks API]({{site.url}}{{site.baseurl}}/api-reference/tasks/) with the task ID returned by the request. Default is `true`. +`task_execution_timeout` | Time | The explicit task execution timeout. Only useful when `wait_for_completion` is set to `false`. Default is `1h`. | No ```json { @@ -189,18 +189,20 @@ Allows you to reduce the number of primary shards in your indexes. With this act "my-alias": {} } ], + "switch_aliases": true, "force_unsafe": false } ``` Parameter | Description | Type | Example | Required :--- | :--- |:--- |:--- | -`num_new_shards` | The maximum number of primary shards in the shrunken index. | integer | `5` | Yes, however it cannot be used with `max_shard_size` or `percentage_of_source_shards` -`max_shard_size` | The maximum size in bytes of a shard for the target index. | keyword | `5gb` | Yes, however it cannot be used with `num_new_shards` or `percentage_of_source_shards` +`num_new_shards` | The maximum number of primary shards in the shrunken index. | Integer | `5` | Yes. It, however, cannot be used with `max_shard_size` or `percentage_of_source_shards`. +`max_shard_size` | The maximum size in bytes of a shard for the target index. | Keyword | `5gb` | Yes, however, it cannot be used with `num_new_shards` or `percentage_of_source_shards`. `percentage_of_source_shards` | Percentage of the number of original primary shards to shrink. This parameter indicates the minimum percentage to use when shrinking the number of primary shards. Must be between 0.0 and 1.0, exclusive. | Percentage | `0.5` | Yes, however it cannot be used with `max_shard_size` or `num_new_shards` -`target_index_name_template` | The name of the shrunken index. Accepts strings and the Mustache variables `{{ctx.index}}` and `{{ctx.indexUuid}}`. | `string` or Mustache template | `{"source": "{{ctx.index}}_shrunken"}` | No -`aliases` | Aliases to add to the new index. | object | `myalias` | No, but must be an array of alias objects -`force_unsafe` | If true, executes the shrink action even if there are no replicas. | boolean | `false` | No +`target_index_name_template` | The name of the shrunken index. Accepts strings and the Mustache variables `{{ctx.index}}` and `{{ctx.indexUuid}}`. | String or Mustache template | `{"source": "{{ctx.index}}_shrunken"}` | No +`aliases` | Aliases to add to the new index. | Object | `myalias` | No. It must be an array of alias objects. +`switch_aliases` | If `true`, copies the aliases from the source index to the target index. If there is a name conflict with an alias from the `aliases` field, the alias in the `aliases` field is used instead of the name. | Boolean | `true` | No. The default implicit value is `false`, which means no aliases are copied by default. +`force_unsafe` | If `true`, shrinks the index even if it has no replicas. | Boolean | `false` | No If you want to add `aliases` to the action, the parameter must include an array of [alias objects]({{site.url}}{{site.baseurl}}/api-reference/alias/). For example,