22==== Synthetic `_source`
33
44IMPORTANT: 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,
66synthetic `_source` is in technical preview. Features in technical preview may
77be changed or removed in a future release. Elastic will work to fix
88any issues, but features in technical preview are not subject to the support SLA
@@ -11,15 +11,19 @@ of official GA features.
1111Though very handy to have around, the source field takes up a significant amount
1212of space on disk. Instead of storing source documents on disk exactly as you
1313send 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----
1818PUT 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
3943commonly <<doc-values,`doc_values`>> and <<stored-fields, stored fields>>. For these field types, no additional space
4044is 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
4347For all other field types, the original value of the field is stored as is, in the same way as the `_source` field in
4448non-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----
228232PUT 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",
0 commit comments