Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/plugins/mapper-annotated-text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ duplicates removed. So:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"text": {
"type": "annotated_text",
Expand Down Expand Up @@ -215,8 +217,10 @@ are preserved.
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"text": { "type": "annotated_text", "store": true }
}
Expand Down
12 changes: 5 additions & 7 deletions docs/reference/mapping/fields/synthetic-source.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ of official GA features.
Though very handy to have around, the source field takes up a significant amount
of space on disk. Instead of storing source documents on disk exactly as you
send them, Elasticsearch can reconstruct source content on the fly upon retrieval.
Enable this by setting `mode: synthetic` in `_source`:
Enable this by configuring the `index.mapper.source.mode` index setting to `synthetic`:

[source,console,id=enable-synthetic-source-example]
----
PUT idx
{
"mappings": {
"_source": {
"mode": "synthetic"
}
"settings": {
"index.mapper.source.mode": "synthetic"
}
}
----
Expand All @@ -41,7 +39,7 @@ For all other field types, the original value of the field is stored as is, in t
[[synthetic-source-restrictions]]
===== Synthetic `_source` restrictions

Synthetic `_source` cannot be used together with field mappings that use <<copy-to,`copy_to`>>.
Synthetic `_source` cannot be used together with field mappings that use <<copy-to,`copy_to`>>.

Some field types have additional restrictions. These restrictions are documented in the **synthetic `_source`** section of the field type's <<mapping-types,documentation>>.

Expand Down Expand Up @@ -164,7 +162,7 @@ Values of `geo_point` fields are represented in synthetic `_source` with reduced

[[synthetic-source-fields-native-list]]
===== Field types that support synthetic source with no storage overhead
The following field types support synthetic source using data from <<doc-values,`doc_values`>> or <<stored-fields, stored fields>>, and require no additional storage space to construct the `_source` field.
The following field types support synthetic source using data from <<doc-values,`doc_values`>> or <<stored-fields, stored fields>>, and require no additional storage space to construct the `_source` field.

NOTE: If you enable the <<ignore-malformed,`ignore_malformed`>> or <<ignore-above,`ignore_above`>> settings, then additional storage is required to store ignored field values for these types.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"agg_metric": {
"type": "aggregate_metric_double",
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/binary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ of official GA features.
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"binary": { "type": "binary", "doc_values": true }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/boolean.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ Synthetic source always sorts `boolean` fields. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"bool": { "type": "boolean" }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/date.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ Synthetic source always sorts `date` fields. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"date": { "type": "date" }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/date_nanos.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ Synthetic source always sorts `date_nanos` fields. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"date": { "type": "date_nanos" }
}
Expand Down
12 changes: 9 additions & 3 deletions docs/reference/mapping/types/flattened.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"flattened": { "type": "flattened" }
}
Expand Down Expand Up @@ -367,8 +369,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"flattened": { "type": "flattened" }
}
Expand Down Expand Up @@ -407,8 +411,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"flattened": { "type": "flattened" }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/geo-point.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ longitude) and reduces them to their stored precision. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"point": { "type": "geo_point" }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/ip.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ Synthetic source always sorts `ip` fields and removes duplicates. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"ip": { "type": "ip" }
}
Expand Down
12 changes: 9 additions & 3 deletions docs/reference/mapping/types/keyword.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"kwd": { "type": "keyword" }
}
Expand Down Expand Up @@ -218,8 +220,10 @@ are preserved. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"kwd": { "type": "keyword", "store": true }
}
Expand Down Expand Up @@ -248,8 +252,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"kwd": { "type": "keyword", "ignore_above": 3 }
}
Expand Down
8 changes: 6 additions & 2 deletions docs/reference/mapping/types/numeric.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ Synthetic source always sorts numeric fields. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"long": { "type": "long" }
}
Expand All @@ -287,8 +289,10 @@ Scaled floats will always apply their scaling factor so:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"f": { "type": "scaled_float", "scaling_factor": 0.01 }
}
Expand Down
20 changes: 15 additions & 5 deletions docs/reference/mapping/types/range.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ Synthetic source always sorts values and removes duplicates for all `range` fiel
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"my_range": { "type": "long_range" }
}
Expand Down Expand Up @@ -316,8 +318,10 @@ For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"my_range": { "type": "ip_range" }
}
Expand Down Expand Up @@ -357,8 +361,10 @@ Range field vales are always represented as inclusive on both sides with bounds
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"my_range": { "type": "long_range" }
}
Expand Down Expand Up @@ -394,8 +400,10 @@ Default values for range bounds are represented as `null` in synthetic source. T
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"my_range": { "type": "integer_range" }
}
Expand Down Expand Up @@ -429,8 +437,10 @@ Will become:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"my_range": { "type": "date_range" }
}
Expand Down
8 changes: 6 additions & 2 deletions docs/reference/mapping/types/text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ duplicates removed. So:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"text": {
"type": "text",
Expand Down Expand Up @@ -233,8 +235,10 @@ are preserved.
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"text": { "type": "text", "store": true }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/version.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ Synthetic source always sorts `version` fields and removes duplicates. For examp
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"versions": { "type": "version" }
}
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/mapping/types/wildcard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ Synthetic source always sorts `wildcard` fields. For example:
----
PUT idx
{
"settings": {
"index.mapper.source.mode": "synthetic"
},
"mappings": {
"_source": { "mode": "synthetic" },
"properties": {
"card": { "type": "wildcard" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ synthetic _source:
indices.create:
index: test_synthetic
body:
settings:
index.mapper.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
page:
type: keyword
Expand Down
4 changes: 4 additions & 0 deletions modules/lang-painless/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ esplugin.bundleSpec.into("spi") {
from(configurations.spi)
}

tasks.named("yamlRestCompatTestTransform").configure({ task ->
task.addAllowedWarning("The mode attribute for _source meta field mapper has been deprecated and will be removed in a future version")
})

/**********************************************
* Context API Generation *
**********************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ setup:
index: test_synthetic
body:
settings:
number_of_shards: 1
index.number_of_shards: 1
index.mapper.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
boolean:
type: boolean
Expand Down Expand Up @@ -5629,10 +5628,9 @@ version and sequence number synthetic _source:
index: versiontest
body:
settings:
number_of_shards: 1
index.mapper.source.mode: synthetic
index.number_of_shards: 1
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
Expand Down
Loading