Skip to content

Commit 0b51fd9

Browse files
Replace usages of _source.mode in documentation (elastic#114743)
We will deprecate the `_source.mode` mapping level configuration in favor of the index-level `index.mapping.source.mode` setting. As a result, we go through the documentation and update it to reflect the introduction of the setting. (cherry picked from commit f6a1e36)
1 parent f4eba62 commit 0b51fd9

15 files changed

+252
-43
lines changed

docs/plugins/mapper-annotated-text.asciidoc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,16 @@ duplicates removed. So:
167167
----
168168
PUT idx
169169
{
170+
"settings": {
171+
"index": {
172+
"mapping": {
173+
"source": {
174+
"mode": "synthetic"
175+
}
176+
}
177+
}
178+
},
170179
"mappings": {
171-
"_source": { "mode": "synthetic" },
172180
"properties": {
173181
"text": {
174182
"type": "annotated_text",
@@ -215,8 +223,16 @@ are preserved.
215223
----
216224
PUT idx
217225
{
226+
"settings": {
227+
"index": {
228+
"mapping": {
229+
"source": {
230+
"mode": "synthetic"
231+
}
232+
}
233+
}
234+
},
218235
"mappings": {
219-
"_source": { "mode": "synthetic" },
220236
"properties": {
221237
"text": { "type": "annotated_text", "store": true }
222238
}

docs/reference/mapping/fields/synthetic-source.asciidoc

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
==== Synthetic `_source`
33

44
IMPORTANT: Synthetic `_source` is Generally Available only for TSDB indices
5-
(indices that have `index.mode` set to `time_series`). For other indices
5+
(indices that have `index.mode` set to `time_series`). For other indices,
66
synthetic `_source` is in technical preview. Features in technical preview may
77
be changed or removed in a future release. Elastic will work to fix
88
any issues, but features in technical preview are not subject to the support SLA
@@ -11,15 +11,19 @@ of official GA features.
1111
Though very handy to have around, the source field takes up a significant amount
1212
of space on disk. Instead of storing source documents on disk exactly as you
1313
send them, Elasticsearch can reconstruct source content on the fly upon retrieval.
14-
Enable this by setting `mode: synthetic` in `_source`:
14+
Enable this by using the value `synthetic` for the index setting `index.mapping.source.mode`:
1515

1616
[source,console,id=enable-synthetic-source-example]
1717
----
1818
PUT idx
1919
{
20-
"mappings": {
21-
"_source": {
22-
"mode": "synthetic"
20+
"settings": {
21+
"index": {
22+
"mapping": {
23+
"source": {
24+
"mode": "synthetic"
25+
}
26+
}
2327
}
2428
}
2529
}
@@ -38,7 +42,7 @@ properties when used with synthetic `_source`.
3842
<<synthetic-source-fields-native-list, Most field types>> construct synthetic `_source` using existing data, most
3943
commonly <<doc-values,`doc_values`>> and <<stored-fields, stored fields>>. For these field types, no additional space
4044
is needed to store the contents of `_source` field. Due to the storage layout of <<doc-values,`doc_values`>>, the
41-
generated `_source` field undergoes <<synthetic-source-modifications, modifications>> compared to original document.
45+
generated `_source` field undergoes <<synthetic-source-modifications, modifications>> compared to the original document.
4246

4347
For all other field types, the original value of the field is stored as is, in the same way as the `_source` field in
4448
non-synthetic mode. In this case there are no modifications and field data in `_source` is the same as in the original
@@ -227,10 +231,16 @@ For instance:
227231
----
228232
PUT idx_keep
229233
{
234+
"settings": {
235+
"index": {
236+
"mapping": {
237+
"source": {
238+
"mode": "synthetic"
239+
}
240+
}
241+
}
242+
},
230243
"mappings": {
231-
"_source": {
232-
"mode": "synthetic"
233-
},
234244
"properties": {
235245
"path": {
236246
"type": "object",

docs/reference/mapping/types/aggregate-metric-double.asciidoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,16 @@ For example:
267267
----
268268
PUT idx
269269
{
270+
"settings": {
271+
"index": {
272+
"mapping": {
273+
"source": {
274+
"mode": "synthetic"
275+
}
276+
}
277+
}
278+
},
270279
"mappings": {
271-
"_source": { "mode": "synthetic" },
272280
"properties": {
273281
"agg_metric": {
274282
"type": "aggregate_metric_double",

docs/reference/mapping/types/boolean.asciidoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,16 @@ Synthetic source always sorts `boolean` fields. For example:
249249
----
250250
PUT idx
251251
{
252+
"settings": {
253+
"index": {
254+
"mapping": {
255+
"source": {
256+
"mode": "synthetic"
257+
}
258+
}
259+
}
260+
},
252261
"mappings": {
253-
"_source": { "mode": "synthetic" },
254262
"properties": {
255263
"bool": { "type": "boolean" }
256264
}

docs/reference/mapping/types/date.asciidoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The following parameters are accepted by `date` fields:
138138
<<ignore-malformed,`ignore_malformed`>>::
139139

140140
If `true`, malformed numbers are ignored. If `false` (default), malformed
141-
numbers throw an exception and reject the whole document. Note that this
141+
numbers throw an exception and reject the whole document. Note that this
142142
cannot be set if the `script` parameter is used.
143143

144144
<<mapping-index,`index`>>::
@@ -256,8 +256,16 @@ Synthetic source always sorts `date` fields. For example:
256256
----
257257
PUT idx
258258
{
259+
"settings": {
260+
"index": {
261+
"mapping": {
262+
"source": {
263+
"mode": "synthetic"
264+
}
265+
}
266+
}
267+
},
259268
"mappings": {
260-
"_source": { "mode": "synthetic" },
261269
"properties": {
262270
"date": { "type": "date" }
263271
}

docs/reference/mapping/types/date_nanos.asciidoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,16 @@ Synthetic source always sorts `date_nanos` fields. For example:
160160
----
161161
PUT idx
162162
{
163+
"settings": {
164+
"index": {
165+
"mapping": {
166+
"source": {
167+
"mode": "synthetic"
168+
}
169+
}
170+
}
171+
},
163172
"mappings": {
164-
"_source": { "mode": "synthetic" },
165173
"properties": {
166174
"date": { "type": "date_nanos" }
167175
}

docs/reference/mapping/types/flattened.asciidoc

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,16 @@ For example:
334334
----
335335
PUT idx
336336
{
337+
"settings": {
338+
"index": {
339+
"mapping": {
340+
"source": {
341+
"mode": "synthetic"
342+
}
343+
}
344+
}
345+
},
337346
"mappings": {
338-
"_source": { "mode": "synthetic" },
339347
"properties": {
340348
"flattened": { "type": "flattened" }
341349
}
@@ -367,8 +375,16 @@ For example:
367375
----
368376
PUT idx
369377
{
378+
"settings": {
379+
"index": {
380+
"mapping": {
381+
"source": {
382+
"mode": "synthetic"
383+
}
384+
}
385+
}
386+
},
370387
"mappings": {
371-
"_source": { "mode": "synthetic" },
372388
"properties": {
373389
"flattened": { "type": "flattened" }
374390
}
@@ -407,8 +423,16 @@ For example:
407423
----
408424
PUT idx
409425
{
426+
"settings": {
427+
"index": {
428+
"mapping": {
429+
"source": {
430+
"mode": "synthetic"
431+
}
432+
}
433+
}
434+
},
410435
"mappings": {
411-
"_source": { "mode": "synthetic" },
412436
"properties": {
413437
"flattened": { "type": "flattened" }
414438
}

docs/reference/mapping/types/geo-point.asciidoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,16 @@ longitude) and reduces them to their stored precision. For example:
229229
----
230230
PUT idx
231231
{
232+
"settings": {
233+
"index": {
234+
"mapping": {
235+
"source": {
236+
"mode": "synthetic"
237+
}
238+
}
239+
}
240+
},
232241
"mappings": {
233-
"_source": { "mode": "synthetic" },
234242
"properties": {
235243
"point": { "type": "geo_point" }
236244
}

docs/reference/mapping/types/ip.asciidoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,16 @@ Synthetic source always sorts `ip` fields and removes duplicates. For example:
170170
----
171171
PUT idx
172172
{
173+
"settings": {
174+
"index": {
175+
"mapping": {
176+
"source": {
177+
"mode": "synthetic"
178+
}
179+
}
180+
}
181+
},
173182
"mappings": {
174-
"_source": { "mode": "synthetic" },
175183
"properties": {
176184
"ip": { "type": "ip" }
177185
}

docs/reference/mapping/types/keyword.asciidoc

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,16 @@ For example:
188188
----
189189
PUT idx
190190
{
191+
"settings": {
192+
"index": {
193+
"mapping": {
194+
"source": {
195+
"mode": "synthetic"
196+
}
197+
}
198+
}
199+
},
191200
"mappings": {
192-
"_source": { "mode": "synthetic" },
193201
"properties": {
194202
"kwd": { "type": "keyword" }
195203
}
@@ -218,8 +226,16 @@ are preserved. For example:
218226
----
219227
PUT idx
220228
{
229+
"settings": {
230+
"index": {
231+
"mapping": {
232+
"source": {
233+
"mode": "synthetic"
234+
}
235+
}
236+
}
237+
},
221238
"mappings": {
222-
"_source": { "mode": "synthetic" },
223239
"properties": {
224240
"kwd": { "type": "keyword", "store": true }
225241
}
@@ -248,8 +264,16 @@ For example:
248264
----
249265
PUT idx
250266
{
267+
"settings": {
268+
"index": {
269+
"mapping": {
270+
"source": {
271+
"mode": "synthetic"
272+
}
273+
}
274+
}
275+
},
251276
"mappings": {
252-
"_source": { "mode": "synthetic" },
253277
"properties": {
254278
"kwd": { "type": "keyword", "ignore_above": 3 }
255279
}

0 commit comments

Comments
 (0)