Skip to content

Commit 4443cb2

Browse files
szabostevelcawl
andauthored
[DOCS] Adds retention_policy to PUT Transform API docs (#68656)
Co-authored-by: lcawl <[email protected]>
1 parent 528d029 commit 4443cb2

File tree

5 files changed

+113
-8
lines changed

5 files changed

+113
-8
lines changed

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ history of operations on a shard.
200200
end::docs-deleted[]
201201

202202
tag::docs-deleted-transform[]
203-
The number of documents that have been deleted from the destination index
204-
for the {transform}.
203+
The number of documents that have been deleted from the destination index due to
204+
the retention policy for this {transform}.
205205
end::docs-deleted-transform[]
206206

207207
tag::docs-indexed[]
@@ -990,6 +990,24 @@ The `latest` method transforms the data by finding the latest document for each
990990
unique key.
991991
end::transform-latest[]
992992

993+
tag::transform-retention[]
994+
Defines a retention policy for the {transform}. Data that meets the defined
995+
criteria is deleted from the destination index.
996+
end::transform-retention[]
997+
998+
tag::transform-retention-time[]
999+
Specifies that the {transform} uses a time field to set the retention policy.
1000+
end::transform-retention-time[]
1001+
1002+
tag::transform-retention-time-field[]
1003+
The date field that is used to calculate the age of the document.
1004+
end::transform-retention-time-field[]
1005+
1006+
tag::transform-retention-time-max-age[]
1007+
Specifies the maximum age of a document in the destination index. Documents that
1008+
are older than the configured value are removed from the destination index.
1009+
end::transform-retention-time-max-age[]
1010+
9931011
tag::transform-settings[]
9941012
Defines optional {transform} settings.
9951013
end::transform-settings[]

docs/reference/transform/apis/get-transform-stats.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ The API returns the following results:
310310
"pages_processed" : 78,
311311
"documents_processed" : 6027,
312312
"documents_indexed" : 68,
313+
"documents_deleted": 22,
314+
"delete_time_in_ms": 214,
313315
"trigger_count" : 168,
314316
"index_time_in_ms" : 412,
315317
"index_total" : 20,

docs/reference/transform/apis/preview-transform.asciidoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,32 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=pivot-group-by]
120120
====
121121
//End pivot
122122

123+
//Begin retention policy
124+
`retention_policy`::
125+
(Optional, object)
126+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention]
127+
+
128+
.Properties of `retention_policy`
129+
[%collapsible%open]
130+
====
131+
`time`:::
132+
(Required, object)
133+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time]
134+
+
135+
.Properties of `time`
136+
[%collapsible%open]
137+
=====
138+
`field`:::
139+
(Required, string)
140+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-field]
141+
142+
`max_age`:::
143+
(Required, <<time-units, time units>>)
144+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-max-age]
145+
=====
146+
====
147+
//End retention policy
148+
123149
//Begin source
124150
`source`::
125151
(Required, object)

docs/reference/transform/apis/put-transform.asciidoc

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ For more information, see <<built-in-roles>>, <<security-privileges>>, and
3232
[[put-transform-desc]]
3333
== {api-description-title}
3434

35-
This API defines a {transform}, which copies data from source indices,
35+
This API defines a {transform}, which copies data from source indices,
3636
transforms it, and persists it into an entity-centric destination index. If you
3737
choose to use the pivot method for your {transform}, the entities are defined by
3838
the set of `group_by` fields in the `pivot` object. If you choose to use the
3939
latest method, the entities are defined by the `unique_key` field values in the
4040
`latest` object.
4141

42-
You can also think of the destination index as a two-dimensional tabular data structure (known as a {dataframe}). The ID for each document in the
43-
{dataframe} is generated from a hash of the entity, so there is a unique row
44-
per entity. For more information, see <<transforms>>.
42+
You can also think of the destination index as a two-dimensional tabular data
43+
structure (known as a {dataframe}). The ID for each document in the {dataframe}
44+
is generated from a hash of the entity, so there is a unique row per entity. For
45+
more information, see <<transforms>>.
4546

4647
When the {transform} is created, a series of validations occur to
4748
ensure its success. For example, there is a check for the existence of the
@@ -151,6 +152,32 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=pivot-group-by]
151152
====
152153
//End pivot
153154

155+
//Begin retention policy
156+
`retention_policy`::
157+
(Optional, object)
158+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention]
159+
+
160+
.Properties of `retention_policy`
161+
[%collapsible%open]
162+
====
163+
`time`:::
164+
(Required, object)
165+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time]
166+
+
167+
.Properties of `time`
168+
[%collapsible%open]
169+
=====
170+
`field`:::
171+
(Required, string)
172+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-field]
173+
174+
`max_age`:::
175+
(Required, <<time-units, time units>>)
176+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-max-age]
177+
=====
178+
====
179+
//End retention policy
180+
154181
//Begin settings
155182
`settings`::
156183
(Optional, object)
@@ -279,6 +306,12 @@ PUT _transform/ecommerce_transform1
279306
"field": "order_date",
280307
"delay": "60s"
281308
}
309+
},
310+
"retention_policy": {
311+
"time": {
312+
"field": "order_date",
313+
"max_age": "30d"
314+
}
282315
}
283316
}
284317
--------------------------------------------------

docs/reference/transform/apis/update-transform.asciidoc

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ When the {transform} is updated, a series of validations occur to ensure its
4040
success. You can use the `defer_validation` parameter to skip these checks.
4141

4242
All updated properties except description do not take effect until after the
43-
{transform} starts the next checkpoint. This is so there is consistency with the
44-
pivoted data in each checkpoint.
43+
{transform} starts the next checkpoint. This is so there is data consistency in
44+
each checkpoint.
4545

4646
[IMPORTANT]
4747
====
@@ -102,6 +102,32 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-pipeline]
102102
(Optional, <<time-units, time units>>)
103103
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=frequency]
104104

105+
//Begin retention policy
106+
`retention_policy`::
107+
(Optional, object)
108+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention]
109+
+
110+
.Properties of `retention_policy`
111+
[%collapsible%open]
112+
====
113+
`time`:::
114+
(Required, object)
115+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time]
116+
+
117+
.Properties of `time`
118+
[%collapsible%open]
119+
=====
120+
`field`:::
121+
(Required, string)
122+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-field]
123+
124+
`max_age`:::
125+
(Required, <<time-units, time units>>)
126+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-retention-time-max-age]
127+
=====
128+
====
129+
//End retention policy
130+
105131
//Begin settings
106132
`settings`::
107133
(Optional, object)

0 commit comments

Comments
 (0)