Skip to content

Commit 02cee8b

Browse files
fix: replace usages of _source.mode in documentation
1 parent e145199 commit 02cee8b

16 files changed

+278
-61
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/binary.asciidoc

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,32 @@ be changed or removed in a future release. Elastic will work to fix
6363
any issues, but features in technical preview are not subject to the support SLA
6464
of official GA features.
6565

66-
`binary` fields support <<synthetic-source,synthetic `_source`>> only when <<doc-values,`doc_values`>> are enabled. Synthetic source always sorts `binary` values in order of their byte representation. For example:
67-
[source,console,id=synthetic-source-binary-example]
68-
----
69-
PUT idx
70-
{
71-
"mappings": {
72-
"_source": { "mode": "synthetic" },
73-
"properties": {
74-
"binary": { "type": "binary", "doc_values": true }
75-
}
76-
}
77-
}
78-
PUT idx/_doc/1
79-
{
80-
"binary": ["IAA=", "EAA="]
81-
}
82-
----
83-
// TEST[s/$/\nGET idx\/_doc\/1?filter_path=_source\n/]
66+
`binary` fields support <<synthetic-source,synthetic `_source`>> only when <<doc-values,`doc_values`>> are enabled. Synthetic source always sorts `binary` values in order of their byte representation. For example:
67+
[source,console,id=synthetic-source-binary-example]
68+
----
69+
PUT idx
70+
{
71+
"settings": {
72+
"index": {
73+
"mapping": {
74+
"source": {
75+
"mode": "synthetic"
76+
}
77+
}
78+
}
79+
},
80+
"mappings": {
81+
"properties": {
82+
"binary": { "type": "binary", "doc_values": true }
83+
}
84+
}
85+
}
86+
PUT idx/_doc/1
87+
{
88+
"binary": ["IAA=", "EAA="]
89+
}
90+
----
91+
// TEST[s/$/\nGET idx\/_doc\/1?filter_path=_source\n/]
8492

8593
Will become:
8694
[source,console-result]

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
@@ -130,7 +130,7 @@ The following parameters are accepted by `date` fields:
130130
<<ignore-malformed,`ignore_malformed`>>::
131131

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

136136
<<mapping-index,`index`>>::
@@ -248,8 +248,16 @@ Synthetic source always sorts `date` fields. For example:
248248
----
249249
PUT idx
250250
{
251+
"settings": {
252+
"index": {
253+
"mapping": {
254+
"source": {
255+
"mode": "synthetic"
256+
}
257+
}
258+
}
259+
},
251260
"mappings": {
252-
"_source": { "mode": "synthetic" },
253261
"properties": {
254262
"date": { "type": "date" }
255263
}

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
}

0 commit comments

Comments
 (0)