|
12 | 12 | import org.elasticsearch.common.compress.CompressedXContent; |
13 | 13 | import org.elasticsearch.core.CheckedConsumer; |
14 | 14 | import org.elasticsearch.index.IndexVersion; |
15 | | -import org.elasticsearch.index.IndexVersions; |
16 | 15 | import org.elasticsearch.index.mapper.MapperService.MergeReason; |
17 | 16 | import org.elasticsearch.test.index.IndexVersionUtils; |
18 | 17 | import org.elasticsearch.xcontent.XContentBuilder; |
@@ -142,52 +141,4 @@ public final void testFixedMetaFieldsAreNotConfigurable() throws IOException { |
142 | 141 | ); |
143 | 142 | assertEquals("Failed to parse mapping: " + fieldName() + " is not configurable", exception.getMessage()); |
144 | 143 | } |
145 | | - |
146 | | - public void testTypeAndFriendsAreSilentlyIgnoredBefore_8_6_0() throws IOException { |
147 | | - assumeTrue("Metadata field " + fieldName() + " isn't configurable", isConfigurable()); |
148 | | - IndexVersion previousVersion = IndexVersionUtils.getPreviousVersion(IndexVersions.V_8_6_0); |
149 | | - IndexVersion version = IndexVersionUtils.randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, previousVersion); |
150 | | - assumeTrue("Metadata field " + fieldName() + " is not supported on version " + version, isSupportedOn(version)); |
151 | | - MapperService mapperService = createMapperService(version, mapping(b -> {})); |
152 | | - // these parameters were previously silently ignored, they will still be ignored in existing indices |
153 | | - String[] unsupportedParameters = new String[] { "fields", "copy_to", "boost", "type" }; |
154 | | - for (String param : unsupportedParameters) { |
155 | | - String mappingAsString = "{\n" |
156 | | - + " \"_doc\" : {\n" |
157 | | - + " \"" |
158 | | - + fieldName() |
159 | | - + "\" : {\n" |
160 | | - + " \"" |
161 | | - + param |
162 | | - + "\" : \"any\"\n" |
163 | | - + " }\n" |
164 | | - + " }\n" |
165 | | - + "}"; |
166 | | - assertNotNull(mapperService.parseMapping("_doc", MergeReason.MAPPING_UPDATE, new CompressedXContent(mappingAsString))); |
167 | | - } |
168 | | - } |
169 | | - |
170 | | - public void testTypeAndFriendsAreDeprecatedFrom_8_6_0() throws IOException { |
171 | | - assumeTrue("Metadata field " + fieldName() + " isn't configurable", isConfigurable()); |
172 | | - IndexVersion version = IndexVersionUtils.randomVersionBetween(random(), IndexVersions.V_8_6_0, IndexVersion.current()); |
173 | | - assumeTrue("Metadata field " + fieldName() + " is not supported on version " + version, isSupportedOn(version)); |
174 | | - MapperService mapperService = createMapperService(version, mapping(b -> {})); |
175 | | - // these parameters were previously silently ignored, they are now deprecated in new indices |
176 | | - String[] unsupportedParameters = new String[] { "fields", "copy_to", "boost", "type" }; |
177 | | - for (String param : unsupportedParameters) { |
178 | | - String mappingAsString = "{\n" |
179 | | - + " \"_doc\" : {\n" |
180 | | - + " \"" |
181 | | - + fieldName() |
182 | | - + "\" : {\n" |
183 | | - + " \"" |
184 | | - + param |
185 | | - + "\" : \"any\"\n" |
186 | | - + " }\n" |
187 | | - + " }\n" |
188 | | - + "}"; |
189 | | - assertNotNull(mapperService.parseMapping("_doc", MergeReason.MAPPING_UPDATE, new CompressedXContent(mappingAsString))); |
190 | | - assertWarnings("Parameter [" + param + "] has no effect on metadata field [" + fieldName() + "] and will be removed in future"); |
191 | | - } |
192 | | - } |
193 | 144 | } |
0 commit comments