Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEST] Replace _source.mode with index.mapping.source.mode in integra…
Browse files Browse the repository at this point in the history
…tion tests - take 2 (elastic#116072)

* Reapply "[TEST] Replace _source.mode with index.mapping.source.mode in integra…" (elastic#116069)

This reverts commit e8bf344.

* [TEST] Replace _source.mode with index.mapping.source.mode in integration tests

* add reason

* add reason

* spotless

* revert unneeded

(cherry picked from commit 4573ab8)

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java
kkrik-es committed Nov 4, 2024
1 parent acc8f5e commit 281673f
Showing 46 changed files with 616 additions and 427 deletions.
Original file line number Diff line number Diff line change
@@ -349,16 +349,17 @@ sequence number and primary term:
---
synthetic _source:
- requires:
cluster_features: ["gte_v8.4.0"]
reason: introduced in 8.4.0
cluster_features: ["mapper.source.mode_from_index_setting"]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test_synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
page:
type: keyword
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"
- do:
indices.create:
index: test
@@ -180,9 +183,9 @@ setup:
body:
settings:
number_of_shards: 1
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
boolean:
type: boolean
@@ -5630,9 +5633,9 @@ version and sequence number synthetic _source:
body:
settings:
number_of_shards: 1
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
Original file line number Diff line number Diff line change
@@ -278,16 +278,17 @@ setup:
---
synthetic_source:
- requires:
cluster_features: ["gte_v8.4.0"]
reason: synthetic source introduced in 8.4.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
foo:
type: match_only_text
@@ -355,16 +356,17 @@ tsdb:
---
synthetic_source with copy_to:
- requires:
cluster_features: ["mapper.source.synthetic_source_with_copy_to_and_doc_values_false"]
reason: requires copy_to support in synthetic source
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
foo:
type: match_only_text
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
setup:
- requires:
cluster_features: ["mapper.source.synthetic_source_fallback"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
pagerank:
type: rank_feature
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
setup:
- requires:
cluster_features: ["mapper.source.synthetic_source_fallback"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
tags:
type: rank_features
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
setup:
- requires:
cluster_features: ["mapper.track_ignored_source"]
reason: requires tracking ignored source
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
a_field:
type: search_as_you_type
Original file line number Diff line number Diff line change
@@ -36,15 +36,17 @@
---
"Synthetic source":
- requires:
cluster_features: ["mapper.track_ignored_source"]
reason: requires tracking ignored source
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
count:
type: token_count
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
supported:
- requires:
cluster_features: ["mapper.source.synthetic_source_fallback"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
join_field:
type: join
Original file line number Diff line number Diff line change
@@ -130,16 +130,17 @@
---
"Synthetic source":
- requires:
cluster_features: ["mapper.source.synthetic_source_fallback"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: queries_index
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
query:
type: percolator
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
update:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
keywords:
- requires:
cluster_features: ["gte_v7.12.0"]
reason: Runtime mappings support was added in 7.12
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: index1
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
field1:
type: keyword
@@ -69,16 +70,17 @@ keywords:
---
doubles:
- requires:
cluster_features: ["gte_v7.12.0"]
reason: Runtime mappings support was added in 7.12
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: index1
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
field1:
type: double
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
setup:
- requires:
cluster_features: ["mapper.annotated_text.synthetic_source"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
stored annotated_text field:
- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -40,9 +41,10 @@ annotated_text field with keyword multi-field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -72,9 +74,10 @@ multiple values in stored annotated_text field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -102,9 +105,10 @@ multiple values in annotated_text field with keyword multi-field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -135,9 +139,10 @@ multiple values in annotated_text field with stored keyword multi-field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -169,9 +174,10 @@ multiple values in stored annotated_text field with keyword multi-field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
@@ -202,9 +208,10 @@ fallback synthetic source:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
annotated_text:
type: annotated_text
Original file line number Diff line number Diff line change
@@ -129,14 +129,18 @@ setup:

---
"Murmur3 docvalue_fields api with synthetic source":
- requires:
cluster_features: ["mapper.source.mode_from_index_setting"]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test_synthetic_source
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
foo:
type: keyword
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
keyword:
- requires:
cluster_features: ["gte_v8.4.0"]
@@ -7,9 +13,10 @@ keyword:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -48,9 +55,8 @@ fetch without refresh also produces synthetic source:
settings:
index:
refresh_interval: -1
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
obj:
properties:
@@ -90,9 +96,10 @@ force_synthetic_source_ok:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: stored
mappings:
_source:
mode: stored
properties:
obj:
properties:
@@ -139,9 +146,10 @@ stored text:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
text:
type: text
@@ -212,9 +220,10 @@ stored keyword:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -253,9 +262,10 @@ doc values keyword with ignore_above:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -336,9 +346,10 @@ stored keyword with ignore_above:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -421,9 +432,10 @@ indexed dense vectors:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -465,9 +477,10 @@ non-indexed dense vectors:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -508,9 +521,10 @@ _source filtering:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -550,9 +564,9 @@ _doc_count:
indices.create:
index: test
body:
mappings:
_source:
mode: synthetic
settings:
index:
mapping.source.mode: synthetic

# with _doc_count
- do:
@@ -679,9 +693,10 @@ fields with ignore_malformed:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
ip:
type: ip
@@ -914,9 +929,10 @@ flattened field:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
flattened:
type: flattened
@@ -1006,9 +1022,10 @@ flattened field with ignore_above:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
field:
type: flattened
@@ -1061,9 +1078,10 @@ flattened field with ignore_above and arrays:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
field:
type: flattened
@@ -1117,9 +1135,10 @@ completion:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
completion:
type: completion

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
object param - store complex object:
- requires:
@@ -8,9 +13,10 @@ object param - store complex object:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -72,9 +78,10 @@ object param - object array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -136,9 +143,10 @@ object param - object array within array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
stored:
synthetic_source_keep: arrays
@@ -179,9 +187,10 @@ object param - no object array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
stored:
synthetic_source_keep: arrays
@@ -221,9 +230,10 @@ object param - field ordering in object array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
a:
type: keyword
@@ -270,9 +280,10 @@ object param - nested object array next to other fields:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
a:
type: keyword
@@ -326,9 +337,10 @@ object param - nested object with stored array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -378,9 +390,10 @@ index param - nested array within array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -428,9 +441,9 @@ index param - nested array within array - disabled second pass:
index:
synthetic_source:
enable_second_doc_parsing_pass: false
mapping.source.mode: synthetic

mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -478,9 +491,8 @@ stored field under object with store_array_source:
index:
sort.field: "name"
sort.order: "asc"
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -525,9 +537,10 @@ field param - keep root array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -582,9 +595,10 @@ field param - keep nested array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -650,9 +664,10 @@ field param - keep root singleton fields:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -739,9 +754,10 @@ field param - keep nested singleton fields:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -820,9 +836,10 @@ field param - nested array within array:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -866,10 +883,9 @@ index param - root arrays:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -945,10 +961,9 @@ index param - dynamic root arrays:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
id:
type: integer
@@ -998,10 +1013,9 @@ index param - object array within array:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
stored:
properties:
@@ -1048,10 +1062,9 @@ index param - no object array:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
stored:
properties:
@@ -1093,10 +1106,9 @@ index param - field ordering:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
a:
type: keyword
@@ -1144,10 +1156,9 @@ index param - nested arrays:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
a:
type: keyword
@@ -1212,10 +1223,9 @@ index param - nested object with stored array:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -1264,10 +1274,9 @@ index param - flattened fields:
settings:
index:
mapping:
source.mode: synthetic
synthetic_source_keep: arrays
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
Original file line number Diff line number Diff line change
@@ -145,41 +145,19 @@
- is_false: test_index.mappings.properties.foo.meta.bar
- match: { test_index.mappings.properties.foo.meta.baz: "quux" }

---
"disabling synthetic source fails":
- requires:
cluster_features: ["gte_v8.4.0"]
reason: "Added in 8.4.0"

- do:
indices.create:
index: test_index
body:
mappings:
_source:
mode: synthetic

- do:
catch: /Cannot update parameter \[mode\] from \[synthetic\] to \[stored\]/
indices.put_mapping:
index: test_index
body:
_source:
mode: stored

---
"enabling synthetic source from explicit succeeds":
- requires:
cluster_features: [ "gte_v8.4.0" ]
reason: "Added in 8.4.0"
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test_index
body:
mappings:
_source:
mode: stored
settings:
index:
mapping.source.mode: stored

- do:
indices.put_mapping:
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
synthetic _source is default:
setup:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new validation logic
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
synthetic _source is default:
- do:
indices.create:
index: test-default-source
@@ -19,20 +20,14 @@ synthetic _source is default:

---
stored _source mode is supported:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new validation logic

- do:
indices.create:
index: test-stored-source
body:
settings:
index:
mode: logsdb
mappings:
_source:
mode: stored
mapping.source.mode: stored
- do:
indices.get:
index: test-stored-source
@@ -41,10 +36,6 @@ stored _source mode is supported:

---
disabled _source is not supported:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new error message

- do:
catch: bad_request
indices.create:
@@ -69,20 +60,14 @@ disabled _source is not supported:
settings:
index:
mode: logsdb
mappings:
_source:
mode: disabled
mapping.source.mode: disabled

- match: { error.type: "mapper_parsing_exception" }
- match: { error.root_cause.0.type: "mapper_parsing_exception" }
- match: { error.reason: "Failed to parse mapping: _source can not be disabled in index using [logsdb] index mode" }

---
include/exclude is not supported with synthetic _source:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new validation logic

- do:
catch: '/filtering the stored _source is incompatible with synthetic source/'
indices.create:
@@ -109,20 +94,16 @@ include/exclude is not supported with synthetic _source:

---
include/exclude is supported with stored _source:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new validation logic

- do:
indices.create:
index: test-includes
body:
settings:
index:
mode: logsdb
mapping.source.mode: stored
mappings:
_source:
mode: stored
includes: [a]

- do:
@@ -139,9 +120,9 @@ include/exclude is supported with stored _source:
settings:
index:
mode: logsdb
mapping.source.mode: stored
mappings:
_source:
mode: stored
excludes: [b]

- do:
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
keyword:
- requires:
cluster_features: ["gte_v8.4.0"]
@@ -7,9 +13,10 @@ keyword:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -62,9 +69,9 @@ keyword with normalizer:
type: custom
filter:
- lowercase
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
@@ -144,9 +151,10 @@ stored text:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
text:
type: text
@@ -193,9 +201,10 @@ force_synthetic_source_ok:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: stored
mappings:
_source:
mode: stored
properties:
obj:
properties:
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
setup:
- requires:
cluster_features: ["gte_v8.4.0"]
reason: introduced in 8.4.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
number_of_shards: 1
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
foo:
type: keyword
@@ -21,6 +21,7 @@ setup:
index_options: positions
vectors:
type: text
store: false
term_vector: with_positions_offsets
positions:
type: text
Original file line number Diff line number Diff line change
@@ -387,16 +387,17 @@
"sparse_vector synthetic source":

- requires:
cluster_features: ["mapper.source.synthetic_source_fallback"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
ml.tokens:
type: sparse_vector
Original file line number Diff line number Diff line change
@@ -49,15 +49,17 @@
---
"binary synthetic source":
- requires:
cluster_features: "gte_v8.15.0"
reason: synthetic source support introduced in 8.15
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
binary:
type: binary
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
keyword:
- requires:
cluster_features: ["gte_v8.4.0"]
@@ -7,9 +13,10 @@ keyword:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -44,9 +51,10 @@ stored text:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
text:
type: text
@@ -83,8 +91,6 @@ stored keyword:
index: test
body:
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -120,9 +126,10 @@ stored keyword without sibling fields:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -165,9 +172,10 @@ force_synthetic_source_ok:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: stored
mappings:
_source:
mode: stored
properties:
obj:
properties:
@@ -218,9 +226,10 @@ doc values keyword with ignore_above:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -286,9 +295,10 @@ stored keyword with ignore_above:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -356,9 +366,10 @@ _source filtering:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -397,9 +408,9 @@ _doc_count:
indices.create:
index: test
body:
mappings:
_source:
mode: synthetic
settings:
index:
mapping.source.mode: synthetic

- do:
index:
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
ignore_above mapping level setting:
- requires:
@@ -10,10 +15,9 @@ ignore_above mapping level setting:
settings:
index:
mapping:
source.mode: synthetic
ignore_above: 10
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
@@ -53,10 +57,9 @@ ignore_above mapping level setting on arrays:
settings:
index:
mapping:
source.mode: synthetic
ignore_above: 10
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
@@ -97,10 +100,9 @@ ignore_above mapping overrides setting:
settings:
index:
mapping:
source.mode: synthetic
ignore_above: 10
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
@@ -143,10 +145,9 @@ ignore_above mapping overrides setting on arrays:
settings:
index:
mapping:
source.mode: synthetic
ignore_above: 10
mappings:
_source:
mode: synthetic
properties:
keyword:
type: keyword
Original file line number Diff line number Diff line change
@@ -427,8 +427,8 @@ nested fields:
---
"Synthetic source":
- requires:
cluster_features: ["gte_v8.10.0"]
reason: Synthetic source shows up in the mapping in 8.10
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
@@ -458,8 +458,8 @@ nested fields:
---
stored source is supported:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new validation logic
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
@@ -472,9 +472,9 @@ stored source is supported:
time_series:
start_time: 2021-04-28T00:00:00Z
end_time: 2021-04-29T00:00:00Z
mapping:
source.mode: stored
mappings:
_source:
mode: stored
properties:
"@timestamp":
type: date
@@ -495,8 +495,8 @@ stored source is supported:
---
disabled source is not supported:
- requires:
cluster_features: ["mapper.source.remove_synthetic_source_only_validation"]
reason: requires new error message
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
catch: bad_request
@@ -510,9 +510,9 @@ disabled source is not supported:
time_series:
start_time: 2021-04-28T00:00:00Z
end_time: 2021-04-29T00:00:00Z
mapping:
source.mode: disabled
mappings:
_source:
mode: disabled
properties:
"@timestamp":
type: date
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
keyword:
- requires:
cluster_features: ["gte_v8.4.0"]
@@ -7,9 +13,10 @@ keyword:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
kwd:
type: keyword
@@ -65,9 +72,10 @@ stored text:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
text:
type: text
Original file line number Diff line number Diff line change
@@ -57,6 +57,8 @@ public Set<NodeFeature> getTestFeatures() {
RangeFieldMapper.DATE_RANGE_INDEXING_FIX,
IgnoredSourceFieldMapper.DONT_EXPAND_DOTS_IN_IGNORED_SOURCE,
SourceFieldMapper.REMOVE_SYNTHETIC_SOURCE_ONLY_VALIDATION,
SourceFieldMapper.SOURCE_MODE_FROM_INDEX_SETTING,
IgnoredSourceFieldMapper.IGNORED_SOURCE_AS_TOP_LEVEL_METADATA_ARRAY_FIELD,
IgnoredSourceFieldMapper.ALWAYS_STORE_OBJECT_ARRAYS_IN_NESTED_OBJECTS,
MapperService.LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT
);
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ public class SourceFieldMapper extends MetadataFieldMapper {
public static final NodeFeature REMOVE_SYNTHETIC_SOURCE_ONLY_VALIDATION = new NodeFeature(
"mapper.source.remove_synthetic_source_only_validation"
);
public static final NodeFeature SOURCE_MODE_FROM_INDEX_SETTING = new NodeFeature("mapper.source.mode_from_index_setting");

public static final String NAME = "_source";
public static final String RECOVERY_SOURCE_NAME = "_recovery_source";
Original file line number Diff line number Diff line change
@@ -2,13 +2,18 @@
setup:
- skip:
features: headers
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
object:
enabled: false
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
constant_keyword:
- requires:
cluster_features: ["gte_v8.4.0"]
reason: introduced in 8.4.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
const_kwd:
type: constant_keyword
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
synthetic source:
- requires:
cluster_features: ["mapper.source.synthetic_source_with_copy_to_and_doc_values_false"]
@@ -7,9 +13,10 @@ synthetic source:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -52,9 +59,10 @@ synthetic source with copy_to:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -111,9 +119,10 @@ synthetic source with disabled doc_values:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
setup:
- requires:
cluster_features: ["gte_v8.5.0"]
reason: "synthetic source support added in 8.5.0"
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test1
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
ver:
type: version
@@ -76,9 +77,10 @@ synthetic source with copy_to:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
ver:
type: version
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
aggregate_metric_double:
- requires:
cluster_features: ["gte_v8.5.0"]
@@ -7,9 +13,10 @@ aggregate_metric_double:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
metric:
type: aggregate_metric_double
@@ -62,9 +69,10 @@ aggregate_metric_double with ignore_malformed:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
metric:
type: aggregate_metric_double
Original file line number Diff line number Diff line change
@@ -175,16 +175,17 @@ setup:
---
histogram with synthetic source:
- requires:
cluster_features: ["gte_v8.5.0"]
reason: introduced in 8.5.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: histo_synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
latency:
type: histogram
@@ -221,16 +222,17 @@ histogram with synthetic source:
---
histogram with synthetic source and zero counts:
- requires:
cluster_features: ["gte_v8.5.0"]
reason: introduced in 8.5.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: histo_synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
latency:
type: histogram
@@ -310,16 +312,17 @@ histogram with large count values:
---
histogram with synthetic source and ignore_malformed:
- requires:
cluster_features: ["mapper.track_ignored_source"]
reason: introduced in 8.15.0
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: histo_synthetic
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
latency:
type: histogram
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: source
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
baz:
type: keyword
Original file line number Diff line number Diff line change
@@ -805,13 +805,18 @@ text:

---
synthetic _source text stored:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
card:
type: text
@@ -836,13 +841,18 @@ synthetic _source text stored:

---
synthetic _source text with parent keyword:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
card:
type: keyword
Original file line number Diff line number Diff line change
@@ -477,13 +477,18 @@ setup:

---
"text with synthetic source":
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test2
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
"emp_no":
type: long
@@ -522,13 +527,18 @@ setup:

---
"stored text with synthetic source":
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test2
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
"emp_no":
type: long
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
setup:
- requires:
cluster_features: ["gte_v8.5.0"]
reason: added in 8.5
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
@@ -11,9 +11,9 @@ setup:
settings:
number_of_shards: 1
number_of_replicas: 0
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
obj:
properties:
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
setup:
- skip:
features: headers
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
cluster.health:
@@ -13,9 +16,10 @@ Filter single field:
indices.create:
index: index_fls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -75,9 +79,10 @@ Filter fields in object:
indices.create:
index: index_fls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -142,9 +147,10 @@ Fields under a disabled object - uses _ignored_source:
indices.create:
index: index_fls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -236,12 +242,11 @@ Dynamic fields beyond limit - uses _ignored_source:
settings:
index:
mapping:
source.mode: synthetic
total_fields:
ignore_dynamic_beyond_limit: true
limit: 2
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -301,9 +306,10 @@ Field with ignored_malformed:
indices.create:
index: index_fls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
setup:
- skip:
features: headers
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
cluster.health:
@@ -13,9 +16,10 @@ Filter on single field:
indices.create:
index: index_dls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -95,9 +99,10 @@ Filter on nested field:
indices.create:
index: index_dls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -178,9 +183,10 @@ Filter on object with stored source:
indices.create:
index: index_dls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -258,9 +264,10 @@ Filter on field within a disabled object:
indices.create:
index: index_dls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -335,9 +342,10 @@ Filter on field with ignored_malformed:
indices.create:
index: index_dls
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
Original file line number Diff line number Diff line change
@@ -95,17 +95,19 @@ setup:
"Failed to snapshot indices with synthetic source":
- skip:
features: ["allowed_warnings"]
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

- do:
indices.create:
index: test_synthetic
body:
mappings:
_source:
mode: synthetic
settings:
number_of_shards: 1
number_of_replicas: 0
index:
mapping.source.mode: synthetic

- do:
snapshot.create:
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
"geo_shape":
- requires:
@@ -8,9 +13,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
shape:
type: geo_shape
@@ -74,9 +80,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
shape:
type: geo_shape
@@ -157,9 +164,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
shape:
type: shape
@@ -223,9 +231,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
shape:
type: shape
@@ -306,9 +315,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
point:
type: geo_point
@@ -422,9 +432,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
geo_point:
type: geo_point
@@ -501,9 +512,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
point:
type: point
@@ -597,9 +609,10 @@
indices.create:
index: test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
point:
type: point
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
simple:
- skip:
features: headers
@@ -6,9 +12,10 @@ simple:
indices.create:
index: airline-data
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
time:
type: date
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
wildcard field type ignore_above:
- requires:
@@ -10,10 +15,9 @@ wildcard field type ignore_above:
settings:
index:
mapping:
source.mode: synthetic
ignore_above: 10
mappings:
_source:
mode: synthetic
properties:
a_wildcard:
type: wildcard
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
setup:
- requires:
cluster_features: [ "mapper.source.mode_from_index_setting" ]
reason: "Source mode configured through index setting"

---
synthetic source:
- requires:
cluster_features: ["mapper.source.synthetic_source_with_copy_to_and_doc_values_false"]
@@ -7,9 +13,10 @@ synthetic source:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword
@@ -48,9 +55,10 @@ synthetic source with copy_to:
indices.create:
index: synthetic_source_test
body:
settings:
index:
mapping.source.mode: synthetic
mappings:
_source:
mode: synthetic
properties:
name:
type: keyword

0 comments on commit 281673f

Please sign in to comment.