Skip to content

Commit

Permalink
Remove maximum_number_trees from mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitris-athanasiou committed Mar 10, 2020
1 parent 6ec6316 commit e46e008
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
"lambda" : {
"type" : "double"
},
"maximum_number_trees" : {
"type" : "integer"
},
"max_trees" : {
"type" : "integer"
},
Expand Down Expand Up @@ -90,9 +87,6 @@
"lambda" : {
"type" : "double"
},
"maximum_number_trees" : {
"type" : "integer"
},
"max_trees" : {
"type" : "integer"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> 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));
}
}

Expand Down

0 comments on commit e46e008

Please sign in to comment.