Skip to content

Commit ccc2d94

Browse files
[DOCS] Explain how to change aliases in data streams documentation (#94110)
1 parent 3205d1f commit ccc2d94

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

docs/reference/alias.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ POST _aliases
9393
You can use the aliases API to perform multiple actions in a single atomic
9494
operation.
9595

96+
// tag::alias-multiple-actions-example[]
9697
For example, the `logs` alias points to a single data stream. The following
9798
request swaps the stream for the alias. During this swap, the `logs` alias has
9899
no downtime and never points to both streams at the same time.
@@ -118,6 +119,7 @@ POST _aliases
118119
}
119120
----
120121
// TEST[s/^/PUT _data_stream\/logs-nginx.access-prod\nPUT _data_stream\/logs-my_app-default\n/]
122+
// end::alias-multiple-actions-example[]
121123

122124
[discrete]
123125
[[add-alias-at-creation]]

docs/reference/data-streams/change-mappings-and-settings.asciidoc

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
[role="xpack"]
1+
[[modify-data-streams]]
2+
== Modify a data stream
3+
4+
[discrete]
25
[[data-streams-change-mappings-and-settings]]
3-
== Change mappings and settings for a data stream
6+
=== Change mappings and settings for a data stream
47

58
Each data stream has a <<create-index-template,matching index
69
template>>. Mappings and index settings from this template are applied to new
@@ -82,7 +85,7 @@ DELETE /_ilm/policy/my-data-stream-policy
8285

8386
[discrete]
8487
[[add-new-field-mapping-to-a-data-stream]]
85-
=== Add a new field mapping to a data stream
88+
==== Add a new field mapping to a data stream
8689

8790
To add a mapping for a new field to a data stream, following these steps:
8891

@@ -161,7 +164,7 @@ PUT /my-data-stream/_mapping?write_index_only=true
161164

162165
[discrete]
163166
[[change-existing-field-mapping-in-a-data-stream]]
164-
=== Change an existing field mapping in a data stream
167+
==== Change an existing field mapping in a data stream
165168

166169
The documentation for each <<mapping-params,mapping parameter>> indicates
167170
whether you can update it for an existing field using the
@@ -269,7 +272,7 @@ data stream and reindex your data into it. See
269272

270273
[discrete]
271274
[[change-dynamic-index-setting-for-a-data-stream]]
272-
=== Change a dynamic index setting for a data stream
275+
==== Change a dynamic index setting for a data stream
273276

274277
To change a <<index-modules-settings,dynamic index setting>> for a data stream,
275278
follow these steps:
@@ -326,7 +329,7 @@ policy. See <<switch-lifecycle-policies>>.
326329

327330
[discrete]
328331
[[change-static-index-setting-for-a-data-stream]]
329-
=== Change a static index setting for a data stream
332+
==== Change a static index setting for a data stream
330333

331334
<<index-modules-settings,Static index settings>> can only be set when a backing
332335
index is created. You cannot update static index settings using the
@@ -371,7 +374,7 @@ new data stream and reindex your data into it. See
371374

372375
[discrete]
373376
[[data-streams-use-reindex-to-change-mappings-settings]]
374-
=== Use reindex to change mappings or settings
377+
==== Use reindex to change mappings or settings
375378

376379
You can use a reindex to change the mappings or settings of a data stream. This
377380
is often required to change the data type of an existing field or update static
@@ -481,15 +484,16 @@ to create this data stream>>. Later, you will reindex older data from an
481484
existing data stream into this new stream. This could result in one or more
482485
backing indices that contains a mix of new and old data.
483486
+
484-
[[data-stream-mix-new-old-data]]
485-
.Mixing new and old data in a data stream
486487
[IMPORTANT]
487-
====
488+
======
489+
[[data-stream-mix-new-old-data]]
490+
*Mixing new and old data in a data stream*
491+
488492
While mixing new and old data is safe, it could interfere with data retention.
489493
If you delete older indices, you could accidentally delete a backing index that
490494
contains both new and old data. To prevent premature data loss, you would need
491495
to retain such a backing index until you are ready to delete its newest data.
492-
====
496+
======
493497
+
494498
--
495499
The following create data stream API request targets `new-data-stream`, which
@@ -683,3 +687,13 @@ backing indices and any data they contain.
683687
DELETE /_data_stream/my-data-stream
684688
----
685689
--
690+
691+
[discrete]
692+
[[data-streams-change-alias]]
693+
=== Update or add an alias to a data stream
694+
695+
Use the <<indices-aliases,aliases API>> to update an existing data stream's
696+
aliases. Changing an existing data stream's aliases in its index pattern has no
697+
effect.
698+
699+
include::../alias.asciidoc[tag=alias-multiple-actions-example]

0 commit comments

Comments
 (0)