From d86f83e960e09ee211299ad9b85f413f03da84b1 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Tue, 21 May 2019 12:48:13 -0700 Subject: [PATCH 1/7] Deprecate support for chained multi-fields. (#41926) We now issue a deprecation warning if a multi-field definition contains a `[fields]` entry. This PR also simplifies the definition of `MultiFieldParserContext`. Addresses #41267. --- .../elasticsearch/index/mapper/Mapper.java | 8 ++-- .../index/mapper/TypeParsers.java | 14 ++++++- .../mapper/ExternalFieldMapperTests.java | 12 ++++++ .../index/mapper/TypeParsersTests.java | 37 +++++++++++++++++++ 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java index d98630e5f765e..5de5394a94abe 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java @@ -136,10 +136,7 @@ public Supplier queryShardContextSupplier() { protected Function similarityLookupService() { return similarityLookupService; } public ParserContext createMultiFieldContext(ParserContext in) { - return new MultiFieldParserContext(in) { - @Override - public boolean isWithinMultiField() { return true; } - }; + return new MultiFieldParserContext(in); } static class MultiFieldParserContext extends ParserContext { @@ -147,6 +144,9 @@ static class MultiFieldParserContext extends ParserContext { super(in.type(), in.similarityLookupService(), in.mapperService(), in.typeParsers(), in.indexVersionCreated(), in.queryShardContextSupplier()); } + + @Override + public boolean isWithinMultiField() { return true; } } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java b/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java index 77d7be62fc1b9..9848a23cac11b 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java @@ -19,8 +19,10 @@ package org.elasticsearch.index.mapper; +import org.apache.logging.log4j.LogManager; import org.apache.lucene.index.IndexOptions; import org.elasticsearch.ElasticsearchParseException; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.AnalysisMode; @@ -37,6 +39,7 @@ import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringValue; public class TypeParsers { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TypeParsers.class)); public static final String DOC_VALUES = "doc_values"; public static final String INDEX_OPTIONS_DOCS = "docs"; @@ -214,11 +217,18 @@ public static void parseField(FieldMapper.Builder builder, String name, Map multiFieldsPropNodes; + parserContext = parserContext.createMultiFieldContext(parserContext); + final Map multiFieldsPropNodes; if (propNode instanceof List && ((List) propNode).isEmpty()) { multiFieldsPropNodes = Collections.emptyMap(); } else if (propNode instanceof Map) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java index 89baa7d2c8a69..2f4b9349986ef 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java @@ -170,6 +170,12 @@ public void testExternalValuesWithMultifield() throws Exception { assertThat(raw, notNullValue()); assertThat(raw.binaryValue(), is(new BytesRef("foo"))); + + assertWarnings("At least one multi-field, [field], was " + + "encountered that itself contains a multi-field. Defining multi-fields within a multi-field is deprecated and will " + + "no longer be supported in 8.0. To resolve the issue, all instances of [fields] that occur within a [fields] block " + + "should be removed from the mappings, either by flattening the chained [fields] blocks into a single level, or " + + "switching to [copy_to] if appropriate."); } public void testExternalValuesWithMultifieldTwoLevels() throws Exception { @@ -235,5 +241,11 @@ public void testExternalValuesWithMultifieldTwoLevels() throws Exception { assertThat(doc.rootDoc().getField("field.raw"), notNullValue()); assertThat(doc.rootDoc().getField("field.raw").stringValue(), is("foo")); + + assertWarnings("At least one multi-field, [field], was " + + "encountered that itself contains a multi-field. Defining multi-fields within a multi-field is deprecated and will " + + "no longer be supported in 8.0. To resolve the issue, all instances of [fields] that occur within a [fields] block " + + "should be removed from the mappings, either by flattening the chained [fields] blocks into a single level, or " + + "switching to [copy_to] if appropriate."); } } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java index bc59c59aa54ab..70f469b96370c 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java @@ -24,7 +24,11 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; +import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; import org.elasticsearch.index.analysis.AnalysisMode; @@ -36,6 +40,7 @@ import org.elasticsearch.index.analysis.TokenFilterFactory; import org.elasticsearch.test.ESTestCase; +import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -157,6 +162,38 @@ public void testParseTextFieldCheckAnalyzerWithSearchAnalyzerAnalysisMode() { TypeParsers.parseTextField(builder, "name", new HashMap<>(fieldNode), parserContext); } + public void testMultiFieldWithinMultiField() throws IOException { + TextFieldMapper.Builder builder = new TextFieldMapper.Builder("textField"); + + XContentBuilder mapping = XContentFactory.jsonBuilder().startObject() + .field("type", "keyword") + .startObject("fields") + .startObject("sub-field") + .field("type", "keyword") + .startObject("fields") + .startObject("sub-sub-field") + .field("type", "keyword") + .endObject() + .endObject() + .endObject() + .endObject() + .endObject(); + + Map fieldNode = XContentHelper.convertToMap( + BytesReference.bytes(mapping), true, mapping.contentType()).v2(); + + Mapper.TypeParser typeParser = new KeywordFieldMapper.TypeParser(); + Mapper.TypeParser.ParserContext parserContext = new Mapper.TypeParser.ParserContext("type", + null, null, type -> typeParser, Version.CURRENT, null); + + TypeParsers.parseField(builder, "some-field", fieldNode, parserContext); + assertWarnings("At least one multi-field, [sub-field], was " + + "encountered that itself contains a multi-field. Defining multi-fields within a multi-field is deprecated and will " + + "no longer be supported in 8.0. To resolve the issue, all instances of [fields] that occur within a [fields] block " + + "should be removed from the mappings, either by flattening the chained [fields] blocks into a single level, or " + + "switching to [copy_to] if appropriate."); + } + private Analyzer createAnalyzerWithMode(String name, AnalysisMode mode) { TokenFilterFactory tokenFilter = new AbstractTokenFilterFactory(indexSettings, name, Settings.EMPTY) { @Override From 22d00edeb8e5a63669bba20a3b04944e1bf4b419 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Tue, 21 May 2019 13:51:27 -0700 Subject: [PATCH 2/7] Update the docs and deprecation info API. --- docs/reference/migration/migrate_7_2.asciidoc | 13 +++++++ .../xpack/deprecation/DeprecationChecks.java | 3 +- .../deprecation/IndexDeprecationChecks.java | 26 +++++++++++++ .../IndexDeprecationChecksTests.java | 39 +++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/docs/reference/migration/migrate_7_2.asciidoc b/docs/reference/migration/migrate_7_2.asciidoc index d8fee4be5821c..14fab5d930bba 100644 --- a/docs/reference/migration/migrate_7_2.asciidoc +++ b/docs/reference/migration/migrate_7_2.asciidoc @@ -29,3 +29,16 @@ In earlier versions you could include a range of ports in entries in the unexpectedly ignored the rest. For instance if you set `discovery.seed_hosts: "10.11.12.13:9300-9310"` then {es} would only use `10.11.12.13:9300` for discovery. Seed host addresses containing port ranges are now rejected. + +[[breaking_72_mapping_changes]] +=== Mapping changes + +[float] +==== Defining multi-fields within multi-fields + +Previously, it was possible to define a multi-field within a multi-field. +Defining chained multi-fields is now deprecated and will no longer be supported +in 8.0. To resolve the issue, all instances of `fields` that occur within a +`fields` block should be removed from the mappings, either by flattening the +chained `fields` blocks into a single level, or by switching to `copy_to` if +appropriate. diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index 3a7dcd786f5bc..b63a828ecbb67 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -47,7 +47,8 @@ private DeprecationChecks() { static List> INDEX_SETTINGS_CHECKS = Collections.unmodifiableList(Arrays.asList( IndexDeprecationChecks::oldIndicesCheck, - IndexDeprecationChecks::tooManyFieldsCheck + IndexDeprecationChecks::tooManyFieldsCheck, + IndexDeprecationChecks::chainedMultiFieldsCheck )); static List> ML_SETTINGS_CHECKS = diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java index 4a56cb78dd144..f544c49b0f646 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java @@ -115,6 +115,32 @@ static DeprecationIssue tooManyFieldsCheck(IndexMetaData indexMetaData) { return null; } + static DeprecationIssue chainedMultiFieldsCheck(IndexMetaData indexMetaData) { + List issues = new ArrayList<>(); + fieldLevelMappingIssue(indexMetaData, ((mappingMetaData, sourceAsMap) -> issues.addAll( + findInPropertiesRecursively(mappingMetaData.type(), sourceAsMap, IndexDeprecationChecks::containsChainedMultiFields)))); + if (issues.size() > 0) { + return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "Multi-fields within multi-fields", + "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + + "#_defining_multi_fields_within_multi_fields", + "The names of fields that contain chained multi-fields: " + issues.toString()); + } + return null; + } + + private static boolean containsChainedMultiFields(Map property) { + if (property.containsKey("fields")) { + Map fields = (Map) property.get("fields"); + for (Object rawSubField: fields.values()) { + Map subField = (Map) rawSubField; + if (subField.containsKey("fields")) { + return true; + } + } + } + return false; + } private static final Set TYPES_THAT_DONT_COUNT; static { diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index 4896bf715a98e..d111b95363886 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -9,7 +9,9 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; @@ -110,6 +112,43 @@ public void testTooManyFieldsCheck() throws IOException { assertEquals(0, withDefaultFieldIssues.size()); } + public void testChainedMultiFields() throws IOException { + XContentBuilder xContent = XContentFactory.jsonBuilder().startObject() + .startObject("properties") + .startObject("field") + .field("type", "keyword") + .startObject("fields") + .startObject("sub-field") + .field("type", "keyword") + .startObject("fields") + .startObject("sub-sub-field") + .field("type", "keyword") + .endObject() + .endObject() + .endObject() + .endObject() + .endObject() + .endObject() + .endObject(); + String mapping = BytesReference.bytes(xContent).utf8ToString(); + + IndexMetaData simpleIndex = IndexMetaData.builder(randomAlphaOfLengthBetween(5, 10)) + .settings(settings(Version.V_7_2_0)) + .numberOfShards(1) + .numberOfReplicas(1) + .putMapping("_doc", mapping) + .build(); + List issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS, c -> c.apply(simpleIndex)); + assertEquals(1, issues.size()); + + DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "Multi-fields within multi-fields", + "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + + "#_defining_multi_fields_within_multi_fields", + "The names of fields that contain chained multi-fields: [[type: _doc, field: field]]"); + assertEquals(singletonList(expected), issues); + } + static void addRandomFields(final int fieldLimit, XContentBuilder mappingBuilder) throws IOException { AtomicInteger fieldCount = new AtomicInteger(0); From 7fb498e9adaf524f70cbbb35a665a4ebcddbcd62 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Wed, 22 May 2019 15:44:56 -0700 Subject: [PATCH 3/7] Lower the deprecation check level to WARNING. --- .../elasticsearch/xpack/deprecation/IndexDeprecationChecks.java | 2 +- .../xpack/deprecation/IndexDeprecationChecksTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java index f544c49b0f646..fcd4ec37e8142 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java @@ -120,7 +120,7 @@ static DeprecationIssue chainedMultiFieldsCheck(IndexMetaData indexMetaData) { fieldLevelMappingIssue(indexMetaData, ((mappingMetaData, sourceAsMap) -> issues.addAll( findInPropertiesRecursively(mappingMetaData.type(), sourceAsMap, IndexDeprecationChecks::containsChainedMultiFields)))); if (issues.size() > 0) { - return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + return new DeprecationIssue(DeprecationIssue.Level.WARNING, "Multi-fields within multi-fields", "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + "#_defining_multi_fields_within_multi_fields", diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index d111b95363886..558ca17df31cd 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -141,7 +141,7 @@ public void testChainedMultiFields() throws IOException { List issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS, c -> c.apply(simpleIndex)); assertEquals(1, issues.size()); - DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING, "Multi-fields within multi-fields", "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + "#_defining_multi_fields_within_multi_fields", From d83200c3725de4726d53ba61d8fc15f4f4338e02 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Wed, 22 May 2019 15:49:58 -0700 Subject: [PATCH 4/7] Test that single-level multi-fields don't produce a deprecation warning. --- .../deprecation/IndexDeprecationChecksTests.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index 558ca17df31cd..cf8808523ffdf 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -115,7 +115,7 @@ public void testTooManyFieldsCheck() throws IOException { public void testChainedMultiFields() throws IOException { XContentBuilder xContent = XContentFactory.jsonBuilder().startObject() .startObject("properties") - .startObject("field") + .startObject("invalid-field") .field("type", "keyword") .startObject("fields") .startObject("sub-field") @@ -128,6 +128,14 @@ public void testChainedMultiFields() throws IOException { .endObject() .endObject() .endObject() + .startObject("valid-field") + .field("type", "keyword") + .startObject("fields") + .startObject("sub-field") + .field("type", "keyword") + .endObject() + .endObject() + .endObject() .endObject() .endObject(); String mapping = BytesReference.bytes(xContent).utf8ToString(); @@ -145,7 +153,7 @@ public void testChainedMultiFields() throws IOException { "Multi-fields within multi-fields", "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + "#_defining_multi_fields_within_multi_fields", - "The names of fields that contain chained multi-fields: [[type: _doc, field: field]]"); + "The names of fields that contain chained multi-fields: [[type: _doc, field: invalid-field]]"); assertEquals(singletonList(expected), issues); } From afc2ca4c2bdd69b88902a868a969d1f36cc81b6a Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Wed, 22 May 2019 16:48:06 -0700 Subject: [PATCH 5/7] Make sure to link to the 8.0 breaking changes docs. --- .../elasticsearch/xpack/deprecation/IndexDeprecationChecks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java index fcd4ec37e8142..1e9876a87fe36 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java @@ -122,7 +122,7 @@ static DeprecationIssue chainedMultiFieldsCheck(IndexMetaData indexMetaData) { if (issues.size() > 0) { return new DeprecationIssue(DeprecationIssue.Level.WARNING, "Multi-fields within multi-fields", - "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html" + "#_defining_multi_fields_within_multi_fields", "The names of fields that contain chained multi-fields: " + issues.toString()); } From 25eecd85ef4597e88b801dd6d2be5ac94d264b49 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Wed, 22 May 2019 16:51:01 -0700 Subject: [PATCH 6/7] Update IndexDeprecationChecksTests. --- .../xpack/deprecation/IndexDeprecationChecksTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index cf8808523ffdf..57813b28b8313 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -151,7 +151,7 @@ public void testChainedMultiFields() throws IOException { DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING, "Multi-fields within multi-fields", - "https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.2.html" + + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html" + "#_defining_multi_fields_within_multi_fields", "The names of fields that contain chained multi-fields: [[type: _doc, field: invalid-field]]"); assertEquals(singletonList(expected), issues); From 8380cb6e1898591381c67fe934fe62c6ff072eb1 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Fri, 24 May 2019 10:28:44 -0700 Subject: [PATCH 7/7] Update version references to 7.3 now that the branch is cut. --- docs/reference/migration/migrate_7_2.asciidoc | 13 ------------- docs/reference/migration/migrate_7_3.asciidoc | 13 +++++++++++++ .../deprecation/IndexDeprecationChecksTests.java | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/reference/migration/migrate_7_2.asciidoc b/docs/reference/migration/migrate_7_2.asciidoc index 14fab5d930bba..d8fee4be5821c 100644 --- a/docs/reference/migration/migrate_7_2.asciidoc +++ b/docs/reference/migration/migrate_7_2.asciidoc @@ -29,16 +29,3 @@ In earlier versions you could include a range of ports in entries in the unexpectedly ignored the rest. For instance if you set `discovery.seed_hosts: "10.11.12.13:9300-9310"` then {es} would only use `10.11.12.13:9300` for discovery. Seed host addresses containing port ranges are now rejected. - -[[breaking_72_mapping_changes]] -=== Mapping changes - -[float] -==== Defining multi-fields within multi-fields - -Previously, it was possible to define a multi-field within a multi-field. -Defining chained multi-fields is now deprecated and will no longer be supported -in 8.0. To resolve the issue, all instances of `fields` that occur within a -`fields` block should be removed from the mappings, either by flattening the -chained `fields` blocks into a single level, or by switching to `copy_to` if -appropriate. diff --git a/docs/reference/migration/migrate_7_3.asciidoc b/docs/reference/migration/migrate_7_3.asciidoc index 5a0b5539ba2cf..ef205b1c60f4b 100644 --- a/docs/reference/migration/migrate_7_3.asciidoc +++ b/docs/reference/migration/migrate_7_3.asciidoc @@ -18,6 +18,19 @@ coming[7.3.0] // end::notable-breaking-changes[] +[[breaking_73_mapping_changes]] +=== Mapping changes + +[float] +==== Defining multi-fields within multi-fields + +Previously, it was possible to define a multi-field within a multi-field. +Defining chained multi-fields is now deprecated and will no longer be supported +in 8.0. To resolve the issue, all instances of `fields` that occur within a +`fields` block should be removed from the mappings, either by flattening the +chained `fields` blocks into a single level, or by switching to `copy_to` if +appropriate. + [[breaking_73_plugin_changes]] === Plugins changes diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index 57813b28b8313..a2634f0206abd 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -141,7 +141,7 @@ public void testChainedMultiFields() throws IOException { String mapping = BytesReference.bytes(xContent).utf8ToString(); IndexMetaData simpleIndex = IndexMetaData.builder(randomAlphaOfLengthBetween(5, 10)) - .settings(settings(Version.V_7_2_0)) + .settings(settings(Version.V_7_3_0)) .numberOfShards(1) .numberOfReplicas(1) .putMapping("_doc", mapping)