You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Reallocate runtime document
Reallocate document `runtime-fields-scriptless` from `runtime-search-request` to `runtime-mapping-fields`
* Move runtime without script section
Move runtime without script section to under the dynamic runtime mapping section
* Fix snippet formatting and remove discrete heading.
* Update test snippet.
Co-authored-by: Adam Locke <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/mapping/runtime.asciidoc
+39-35Lines changed: 39 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -139,22 +139,48 @@ PUT my-index
139
139
}
140
140
----
141
141
142
-
You can update or remove runtime fields at any time. To replace an existing runtime field, add a new runtime field to the mappings with the same name. To remove a runtime field from the mappings, set the value of the runtime field to `null`:
143
-
144
-
[source,console]
145
-
----
146
-
PUT my-index/_mapping
147
-
{
148
-
"runtime": {
149
-
"day_of_week": null
150
-
}
151
-
}
152
-
----
142
+
[[runtime-fields-scriptless]]
143
+
==== Define runtime fields without a script
144
+
You can define a runtime field in the mapping definition without a
145
+
script. At query time, {es} looks in `_source` for a field with the same name
146
+
and returns a value if one exists. If a field with the same name doesn’t
147
+
exist, the response doesn't include any values for that runtime field.
148
+
149
+
[source,console]
150
+
----
151
+
PUT my-index/
152
+
{
153
+
"mappings": {
154
+
"runtime": {
155
+
"day_of_week": {
156
+
"type": "keyword"
157
+
}
158
+
}
159
+
}
160
+
}
161
+
----
153
162
154
163
[[runtime-updating-scripts]]
155
-
.Updating and removing runtime fields
156
-
****
164
+
==== Updating and removing runtime fields
165
+
166
+
You can update or remove runtime fields at any time. To replace an existing
167
+
runtime field, add a new runtime field to the mappings with the same name. To
168
+
remove a runtime field from the mappings, set the value of the runtime field to
169
+
`null`:
157
170
171
+
[source,console]
172
+
----
173
+
PUT my-index/_mapping
174
+
{
175
+
"runtime": {
176
+
"day_of_week": null
177
+
}
178
+
}
179
+
----
180
+
//TEST[continued]
181
+
182
+
.Downstream impacts
183
+
****
158
184
Updating or removing a runtime field while a dependent query is running can return
159
185
inconsistent results. Each shard might have access to different versions of the
160
186
script, depending on when the mapping change takes effect.
@@ -163,7 +189,6 @@ Existing queries or visualizations in {kib} that rely on runtime fields can
163
189
fail if you remove or update the field. For example, a bar chart visualization
164
190
that uses a runtime field of type `ip` will fail if the type is changed
165
191
to `boolean`, or if the runtime field is removed.
166
-
167
192
****
168
193
169
194
[[runtime-search-request]]
@@ -213,27 +238,6 @@ runtime field from a search request to the index mapping by moving the field
213
238
definition from `runtime_mappings` in the search request to the `runtime`
214
239
section of the index mapping.
215
240
216
-
[[runtime-fields-scriptless]]
217
-
==== Define runtime fields without a script
218
-
You can define a runtime field in the mapping definition without a
219
-
script. At query time, {es} looks in `_source` for a field with the same name
220
-
and returns a value if one exists. If a field with the same name doesn’t
221
-
exist, the response doesn't include any values for that runtime field.
0 commit comments