Skip to content

Commit

Permalink
add removeDocValues to each field to stop apps from creating a new in…
Browse files Browse the repository at this point in the history
…dex pattern
  • Loading branch information
neptunian committed May 5, 2020
1 parent aab1fb3 commit 4a2634b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface IndexPatternField {
enabled?: boolean;
script?: string;
lang?: string;
readFromDocValues: boolean;
}
export enum IndexPatternType {
logs = 'logs',
Expand Down Expand Up @@ -237,6 +238,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa
searchable: field.searchable ?? true,
aggregatable: field.aggregatable ?? true,
doc_values: field.doc_values ?? true,
readFromDocValues: field.doc_values ?? true,
};

// if type exists, check if it exists in the map
Expand All @@ -254,6 +256,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa
newField.aggregatable = false;
newField.analyzed = false;
newField.doc_values = field.doc_values ?? false;
newField.readFromDocValues = field.doc_values ?? false;
newField.indexed = false;
newField.searchable = false;
}
Expand All @@ -265,6 +268,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa
newField.aggregatable = false;
newField.analyzed = false;
newField.doc_values = false;
newField.readFromDocValues = false;
newField.indexed = false;
newField.searchable = false;
}
Expand All @@ -279,6 +283,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa
newField.script = field.script;
newField.lang = 'painless';
newField.doc_values = false;
newField.readFromDocValues = false;
}

return newField;
Expand Down

0 comments on commit 4a2634b

Please sign in to comment.