[ML] Adds created_by meta data for file data viz import indexes (#27303)

This commit is contained in:
Pete Harverson 2018-12-17 15:28:04 +00:00 committed by GitHub
parent 64b2399739
commit 6cc9bc2fc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -6,3 +6,7 @@
export const MAX_BYTES = 104857600;
// Value to use in the Elasticsearch index mapping meta data to identify the
// index as having been created by the ML File Data Visualizer.
export const INDEX_META_DATA_CREATED_BY = 'ml_file_data_visualizer';

View file

@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { INDEX_META_DATA_CREATED_BY } from '../../../common/constants/file_datavisualizer';
export function importDataProvider(callWithRequest) {
async function importData(id, index, settings, mappings, ingestPipeline, data) {
@ -81,8 +82,11 @@ export function importDataProvider(callWithRequest) {
const body = {
mappings: {
_doc: {
_meta: {
created_by: INDEX_META_DATA_CREATED_BY
},
properties: mappings
}
},
}
};