Skip to content

[7.x][ML] Do not add runtime section to DFA dest index mappings unnec… #69332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ private static CreateIndexRequest createIndexRequest(Clock clock,
properties.putAll(createAdditionalMappings(config, fieldCapabilitiesResponse));
Map<String, Object> metadata = getOrPutDefault(mappingsAsMap, META, HashMap::new);
metadata.putAll(createMetadata(config.getId(), clock, Version.CURRENT));
Map<String, Object> runtimeMappings = getOrPutDefault(mappingsAsMap, RUNTIME, HashMap::new);
runtimeMappings.putAll(config.getSource().getRuntimeMappings());
if (config.getSource().getRuntimeMappings().isEmpty() == false) {
Map<String, Object> runtimeMappings = getOrPutDefault(mappingsAsMap, RUNTIME, HashMap::new);
runtimeMappings.putAll(config.getSource().getRuntimeMappings());
}
return new CreateIndexRequest(destinationIndex, settings).mapping(type, mappingsAsMap);
}

Expand Down Expand Up @@ -281,8 +283,11 @@ public static void updateMappingsToDestIndex(Client client,

// Determine mappings to be added to the destination index
addedMappings.put(PROPERTIES, createAdditionalMappings(config, fieldCapabilitiesResponse));

// Also add runtime mappings
addedMappings.put(RUNTIME, config.getSource().getRuntimeMappings());
if (config.getSource().getRuntimeMappings().isEmpty() == false) {
addedMappings.put(RUNTIME, config.getSource().getRuntimeMappings());
}

// Add the mappings to the destination index
PutMappingRequest putMappingRequest =
Expand Down