Skip to content

Commit a1b7deb

Browse files
author
David Roberts
authored
[ML] Account for "properties" layer in find_file_structure mappings (#77035) (#77142)
This is the UI side companion for elastic/elasticsearch#62158 Previously the "mappings" field of the response from the find_file_structure endpoint was not a drop-in for the mappings format of the create index endpoint - the "properties" layer was missing. The reason for omitting it initially was that the assumption was that the find_file_structure endpoint would only ever return very simple mappings without any nested objects. However, this will not be true in the future, as we will improve mappings detection for complex JSON objects. As a first step it makes sense to move the returned mappings closer to the standard format.
1 parent 12a4fe4 commit a1b7deb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

x-pack/plugins/ml/common/types/file_datavisualizer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ export interface Settings {
8484
}
8585

8686
export interface Mappings {
87-
[key: string]: any;
87+
_meta?: {
88+
created_by: string;
89+
};
90+
properties: {
91+
[key: string]: any;
92+
};
8893
}
8994

9095
export interface IngestPipelineWrapper {

x-pack/plugins/ml/server/models/file_data_visualizer/import_data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function importDataProvider({ asCurrentUser }: IScopedClusterClient) {
9494
_meta: {
9595
created_by: INDEX_META_DATA_CREATED_BY,
9696
},
97-
properties: mappings,
97+
properties: mappings.properties,
9898
},
9999
};
100100

0 commit comments

Comments
 (0)