From e46e0081229c09a46bfe41ee06a14212af5cae82 Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Tue, 10 Mar 2020 15:39:01 +0200 Subject: [PATCH] Remove maximum_number_trees from mappings --- .../xpack/core/ml/config_index_mappings.json | 6 ------ .../MlConfigIndexMappingsFullClusterRestartIT.java | 11 ++++++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json index 9098ff084afc2..5ee5957e49331 100644 --- a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json +++ b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json @@ -40,9 +40,6 @@ "lambda" : { "type" : "double" }, - "maximum_number_trees" : { - "type" : "integer" - }, "max_trees" : { "type" : "integer" }, @@ -90,9 +87,6 @@ "lambda" : { "type" : "double" }, - "maximum_number_trees" : { - "type" : "integer" - }, "max_trees" : { "type" : "integer" }, diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java index 2dc76febf8dc4..6d8ce026ed3d0 100644 --- a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java @@ -77,7 +77,16 @@ public void testMlConfigIndexMappingsAfterMigration() throws Exception { // trigger .ml-config index mappings update createAnomalyDetectorJob(NEW_CLUSTER_JOB_ID); // assert that the mappings are updated - assertThat(getConfigIndexMappings(), equalTo(expectedConfigIndexMappings)); + Map configIndexMappings = getConfigIndexMappings(); + + // Remove renamed fields + if (getOldClusterVersion().onOrAfter(Version.V_7_7_0)) { + configIndexMappings = XContentMapValues.filter(expectedConfigIndexMappings, null, new String[] { + "analysis.properties.*.properties.maximum_number_trees" // This was renamed to max_trees + }); + } + + assertThat(configIndexMappings, equalTo(expectedConfigIndexMappings)); } }