diff --git a/src/fixtures/logstash_fields.js b/src/fixtures/logstash_fields.js index 57fffe4e4362..94c5fbc8f125 100644 --- a/src/fixtures/logstash_fields.js +++ b/src/fixtures/logstash_fields.js @@ -95,7 +95,7 @@ function stubbedLogstashFields() { return { name, type, - opensearchTypes: [opensearchType], + esTypes: [opensearchType], readFromDocValues: shouldReadFieldFromDocValues(aggregatable, opensearchType), aggregatable, searchable, diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index 0828586e884d..77f9d593d162 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -73,9 +73,9 @@ interface FieldSubType { export interface Field { name: string; type: string; - // opensearchTypes might be undefined on old index patterns that have not been refreshed since we added + // esTypes might be undefined on old index patterns that have not been refreshed since we added // this prop. It is also undefined on scripted fields. - opensearchTypes?: string[]; + esTypes?: string[]; aggregatable: boolean; filterable: boolean; searchable: boolean; diff --git a/src/plugins/data/common/field_formats/field_formats_registry.ts b/src/plugins/data/common/field_formats/field_formats_registry.ts index 5270c3e5e4ac..5260d9b1e21e 100644 --- a/src/plugins/data/common/field_formats/field_formats_registry.ts +++ b/src/plugins/data/common/field_formats/field_formats_registry.ts @@ -76,14 +76,14 @@ export class FieldFormatsRegistry { * using the format:defaultTypeMap config map * * @param {OSD_FIELD_TYPES} fieldType - the field type - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes - Array of OpenSearch data types + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes - Array of OpenSearch data types * @return {FieldType} */ getDefaultConfig = ( fieldType: OSD_FIELD_TYPES, - opensearchTypes?: OPENSEARCH_FIELD_TYPES[] + esTypes?: OPENSEARCH_FIELD_TYPES[] ): FieldFormatConfig => { - const type = this.getDefaultTypeName(fieldType, opensearchTypes); + const type = this.getDefaultTypeName(fieldType, esTypes); return ( (this.defaultMap && this.defaultMap[type]) || { id: FIELD_FORMAT_IDS.STRING, params: {} } @@ -120,14 +120,14 @@ export class FieldFormatsRegistry { * used by the field editor * * @param {OSD_FIELD_TYPES} fieldType - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes - Array of OpenSearch data types + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes - Array of OpenSearch data types * @return {FieldFormatInstanceType | undefined} */ getDefaultType = ( fieldType: OSD_FIELD_TYPES, - opensearchTypes?: OPENSEARCH_FIELD_TYPES[] + esTypes?: OPENSEARCH_FIELD_TYPES[] ): FieldFormatInstanceType | undefined => { - const config = this.getDefaultConfig(fieldType, opensearchTypes); + const config = this.getDefaultConfig(fieldType, esTypes); return this.getType(config.id); }; @@ -136,19 +136,17 @@ export class FieldFormatsRegistry { * Get the name of the default type for OpenSearch types like date_nanos * using the format:defaultTypeMap config map * - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes - Array of OpenSearch data types + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes - Array of OpenSearch data types * @return {OPENSEARCH_FIELD_TYPES | undefined} */ getTypeNameByOpenSearchTypes = ( - opensearchTypes: OPENSEARCH_FIELD_TYPES[] | undefined + esTypes: OPENSEARCH_FIELD_TYPES[] | undefined ): OPENSEARCH_FIELD_TYPES | undefined => { - if (!Array.isArray(opensearchTypes)) { + if (!Array.isArray(esTypes)) { return undefined; } - return opensearchTypes.find( - (type) => this.defaultMap[type] && this.defaultMap[type].opensearch - ); + return esTypes.find((type) => this.defaultMap[type] && this.defaultMap[type].opensearch); }; /** @@ -156,14 +154,14 @@ export class FieldFormatsRegistry { * a field type, using the format:defaultTypeMap. * * @param {OSD_FIELD_TYPES} fieldType - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes * @return {OPENSEARCH_FIELD_TYPES | OSD_FIELD_TYPES} */ getDefaultTypeName = ( fieldType: OSD_FIELD_TYPES, - opensearchTypes?: OPENSEARCH_FIELD_TYPES[] + esTypes?: OPENSEARCH_FIELD_TYPES[] ): OPENSEARCH_FIELD_TYPES | OSD_FIELD_TYPES => { - const opensearchType = this.getTypeNameByOpenSearchTypes(opensearchTypes); + const opensearchType = this.getTypeNameByOpenSearchTypes(esTypes); return opensearchType || fieldType; }; @@ -195,15 +193,15 @@ export class FieldFormatsRegistry { * Get the default fieldFormat instance for a field format. * * @param {OSD_FIELD_TYPES} fieldType - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes * @return {FieldFormat} */ getDefaultInstancePlain = ( fieldType: OSD_FIELD_TYPES, - opensearchTypes?: OPENSEARCH_FIELD_TYPES[], + esTypes?: OPENSEARCH_FIELD_TYPES[], params: Record = {} ): FieldFormat => { - const conf = this.getDefaultConfig(fieldType, opensearchTypes); + const conf = this.getDefaultConfig(fieldType, esTypes); const instanceParams = { ...conf.params, ...params, @@ -215,20 +213,20 @@ export class FieldFormatsRegistry { * Returns a cache key built by the given variables for caching in memoized * Where opensearchType contains fieldType, fieldType is returned * -> OpenSearch Dashboards types have a higher priority in that case - * -> would lead to failing tests that match e.g. date format with/without opensearchTypes + * -> would lead to failing tests that match e.g. date format with/without esTypes * https://lodash.com/docs#memoize * * @param {OSD_FIELD_TYPES} fieldType - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes * @return {String} */ getDefaultInstanceCacheResolver( fieldType: OSD_FIELD_TYPES, - opensearchTypes: OPENSEARCH_FIELD_TYPES[] + esTypes: OPENSEARCH_FIELD_TYPES[] ): string { // @ts-ignore - return Array.isArray(opensearchTypes) && opensearchTypes.indexOf(fieldType) === -1 - ? [fieldType, ...opensearchTypes].join('-') + return Array.isArray(esTypes) && esTypes.indexOf(fieldType) === -1 + ? [fieldType, ...esTypes].join('-') : fieldType; } @@ -254,7 +252,7 @@ export class FieldFormatsRegistry { * It's a memoized function that builds and reads a cache * * @param {OSD_FIELD_TYPES} fieldType - * @param {OPENSEARCH_FIELD_TYPES[]} opensearchTypes + * @param {OPENSEARCH_FIELD_TYPES[]} esTypes * @return {FieldFormat} */ getDefaultInstance = memoize(this.getDefaultInstancePlain, this.getDefaultInstanceCacheResolver); diff --git a/src/plugins/data/common/index_patterns/field.stub.ts b/src/plugins/data/common/index_patterns/field.stub.ts index d323a995a63a..99e346ea49a3 100644 --- a/src/plugins/data/common/index_patterns/field.stub.ts +++ b/src/plugins/data/common/index_patterns/field.stub.ts @@ -35,7 +35,7 @@ import { IFieldType } from '.'; export const stubFields: IFieldType[] = [ { name: 'machine.os', - opensearchTypes: ['text'], + esTypes: ['text'], type: 'string', aggregatable: false, searchable: false, @@ -44,7 +44,7 @@ export const stubFields: IFieldType[] = [ { name: 'machine.os.raw', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], aggregatable: true, searchable: true, filterable: true, @@ -52,7 +52,7 @@ export const stubFields: IFieldType[] = [ { name: 'not.filterable', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], aggregatable: true, searchable: false, filterable: false, @@ -60,7 +60,7 @@ export const stubFields: IFieldType[] = [ { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], aggregatable: true, searchable: true, filterable: true, @@ -68,7 +68,7 @@ export const stubFields: IFieldType[] = [ { name: '@timestamp', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], aggregatable: true, searchable: true, filterable: true, @@ -76,7 +76,7 @@ export const stubFields: IFieldType[] = [ { name: 'clientip', type: 'ip', - opensearchTypes: ['ip'], + esTypes: ['ip'], aggregatable: true, searchable: true, filterable: true, @@ -84,7 +84,7 @@ export const stubFields: IFieldType[] = [ { name: 'bool.field', type: 'boolean', - opensearchTypes: ['boolean'], + esTypes: ['boolean'], aggregatable: true, searchable: true, filterable: true, diff --git a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap index 6e76f3803f31..4279dd320ad6 100644 --- a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap +++ b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap @@ -13,11 +13,11 @@ Object { ], }, "count": 1, - "lang": "lang", - "name": "name", - "opensearchTypes": Array [ + "esTypes": Array [ "text", ], + "lang": "lang", + "name": "name", "readFromDocValues": false, "script": "script", "scripted": true, @@ -47,6 +47,9 @@ Object { ], }, "count": 1, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -55,9 +58,6 @@ Object { }, "lang": "lang", "name": "name", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": "script", "scripted": true, diff --git a/src/plugins/data/common/index_patterns/fields/fields.mocks.ts b/src/plugins/data/common/index_patterns/fields/fields.mocks.ts index eb4a903ca7a4..389dd9dcb029 100644 --- a/src/plugins/data/common/index_patterns/fields/fields.mocks.ts +++ b/src/plugins/data/common/index_patterns/fields/fields.mocks.ts @@ -35,7 +35,7 @@ export const fields: IFieldType[] = [ { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], count: 10, scripted: false, searchable: true, @@ -45,7 +45,7 @@ export const fields: IFieldType[] = [ { name: 'ssl', type: 'boolean', - opensearchTypes: ['boolean'], + esTypes: ['boolean'], count: 20, scripted: false, searchable: true, @@ -55,7 +55,7 @@ export const fields: IFieldType[] = [ { name: '@timestamp', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 30, scripted: false, searchable: true, @@ -65,7 +65,7 @@ export const fields: IFieldType[] = [ { name: 'time', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 30, scripted: false, searchable: true, @@ -75,7 +75,7 @@ export const fields: IFieldType[] = [ { name: '@tags', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -85,7 +85,7 @@ export const fields: IFieldType[] = [ { name: 'utc_time', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 0, scripted: false, searchable: true, @@ -95,7 +95,7 @@ export const fields: IFieldType[] = [ { name: 'phpmemory', type: 'number', - opensearchTypes: ['integer'], + esTypes: ['integer'], count: 0, scripted: false, searchable: true, @@ -105,7 +105,7 @@ export const fields: IFieldType[] = [ { name: 'ip', type: 'ip', - opensearchTypes: ['ip'], + esTypes: ['ip'], count: 0, scripted: false, searchable: true, @@ -115,7 +115,7 @@ export const fields: IFieldType[] = [ { name: 'request_body', type: 'attachment', - opensearchTypes: ['attachment'], + esTypes: ['attachment'], count: 0, scripted: false, searchable: true, @@ -125,7 +125,7 @@ export const fields: IFieldType[] = [ { name: 'point', type: 'geo_point', - opensearchTypes: ['geo_point'], + esTypes: ['geo_point'], count: 0, scripted: false, searchable: true, @@ -135,7 +135,7 @@ export const fields: IFieldType[] = [ { name: 'area', type: 'geo_shape', - opensearchTypes: ['geo_shape'], + esTypes: ['geo_shape'], count: 0, scripted: false, searchable: true, @@ -145,7 +145,7 @@ export const fields: IFieldType[] = [ { name: 'hashed', type: 'murmur3', - opensearchTypes: ['murmur3'], + esTypes: ['murmur3'], count: 0, scripted: false, searchable: true, @@ -155,7 +155,7 @@ export const fields: IFieldType[] = [ { name: 'geo.coordinates', type: 'geo_point', - opensearchTypes: ['geo_point'], + esTypes: ['geo_point'], count: 0, scripted: false, searchable: true, @@ -165,7 +165,7 @@ export const fields: IFieldType[] = [ { name: 'extension', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -175,7 +175,7 @@ export const fields: IFieldType[] = [ { name: 'machine.os', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, @@ -185,7 +185,7 @@ export const fields: IFieldType[] = [ { name: 'machine.os.raw', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -196,7 +196,7 @@ export const fields: IFieldType[] = [ { name: 'geo.src', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -206,7 +206,7 @@ export const fields: IFieldType[] = [ { name: '_id', type: 'string', - opensearchTypes: ['_id'], + esTypes: ['_id'], count: 0, scripted: false, searchable: true, @@ -216,7 +216,7 @@ export const fields: IFieldType[] = [ { name: '_type', type: 'string', - opensearchTypes: ['_type'], + esTypes: ['_type'], count: 0, scripted: false, searchable: true, @@ -226,7 +226,7 @@ export const fields: IFieldType[] = [ { name: '_source', type: '_source', - opensearchTypes: ['_source'], + esTypes: ['_source'], count: 0, scripted: false, searchable: true, @@ -236,7 +236,7 @@ export const fields: IFieldType[] = [ { name: 'non-filterable', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: false, @@ -246,7 +246,7 @@ export const fields: IFieldType[] = [ { name: 'non-sortable', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: false, @@ -256,7 +256,7 @@ export const fields: IFieldType[] = [ { name: 'custom_user_field', type: 'conflict', - opensearchTypes: ['long', 'text'], + esTypes: ['long', 'text'], count: 0, scripted: false, searchable: true, @@ -310,7 +310,7 @@ export const fields: IFieldType[] = [ { name: 'nestedField.child', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, @@ -321,7 +321,7 @@ export const fields: IFieldType[] = [ { name: 'nestedField.nestedChild.doublyNestedChild', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts index 87ec2695b122..2c710b172927 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts +++ b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts @@ -50,7 +50,7 @@ describe('Field', function () { script: 'script', lang: 'lang', count: 1, - opensearchTypes: ['text'], + esTypes: ['text'], aggregatable: true, filterable: true, searchable: true, diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts b/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts index cb90e77b7c8e..4a2b8ca661f8 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts +++ b/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts @@ -102,8 +102,8 @@ export class IndexPatternField implements IFieldType { return this.spec.type; } - public get opensearchTypes() { - return this.spec.opensearchTypes; + public get esTypes() { + return this.spec.esTypes; } public get scripted() { @@ -156,7 +156,7 @@ export class IndexPatternField implements IFieldType { name: this.name, type: this.type, - opensearchTypes: this.opensearchTypes, + esTypes: this.esTypes, scripted: this.scripted, searchable: this.searchable, aggregatable: this.aggregatable, @@ -177,7 +177,7 @@ export class IndexPatternField implements IFieldType { conflictDescriptions: this.conflictDescriptions, name: this.name, type: this.type, - opensearchTypes: this.opensearchTypes, + esTypes: this.esTypes, scripted: this.scripted, searchable: this.searchable, aggregatable: this.aggregatable, diff --git a/src/plugins/data/common/index_patterns/fields/types.ts b/src/plugins/data/common/index_patterns/fields/types.ts index b6853c632518..62c7d595eb36 100644 --- a/src/plugins/data/common/index_patterns/fields/types.ts +++ b/src/plugins/data/common/index_patterns/fields/types.ts @@ -38,9 +38,9 @@ export interface IFieldType { script?: string; lang?: string; count?: number; - // opensearchTypes might be undefined on old index patterns that have not been refreshed since we added + // esTypes might be undefined on old index patterns that have not been refreshed since we added // this prop. It is also undefined on scripted fields. - opensearchTypes?: string[]; + esTypes?: string[]; aggregatable?: boolean; filterable?: boolean; searchable?: boolean; diff --git a/src/plugins/data/common/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/index_patterns/index_pattern.stub.ts index 9db5d57bd827..74b7a3d7755c 100644 --- a/src/plugins/data/common/index_patterns/index_pattern.stub.ts +++ b/src/plugins/data/common/index_patterns/index_pattern.stub.ts @@ -47,7 +47,7 @@ export const stubIndexPatternWithFields: IIndexPattern = { { name: 'response', type: 'number', - opensearchTypes: ['integer'], + esTypes: ['integer'], aggregatable: true, filterable: true, searchable: true, diff --git a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap b/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap index 89f09eb9e3e5..ed84aceb60e5 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap +++ b/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap @@ -7,6 +7,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "keyword", + ], "format": Object { "id": "number", "params": Object { @@ -15,9 +18,6 @@ Object { }, "lang": undefined, "name": "@tags", - "opensearchTypes": Array [ - "keyword", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -29,6 +29,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 30, + "esTypes": Array [ + "date", + ], "format": Object { "id": "number", "params": Object { @@ -37,9 +40,6 @@ Object { }, "lang": undefined, "name": "@timestamp", - "opensearchTypes": Array [ - "date", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -51,6 +51,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "_id", + ], "format": Object { "id": "number", "params": Object { @@ -59,9 +62,6 @@ Object { }, "lang": undefined, "name": "_id", - "opensearchTypes": Array [ - "_id", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -73,6 +73,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "_source", + ], "format": Object { "id": "number", "params": Object { @@ -81,9 +84,6 @@ Object { }, "lang": undefined, "name": "_source", - "opensearchTypes": Array [ - "_source", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -95,6 +95,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "_type", + ], "format": Object { "id": "number", "params": Object { @@ -103,9 +106,6 @@ Object { }, "lang": undefined, "name": "_type", - "opensearchTypes": Array [ - "_type", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -117,6 +117,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "geo_shape", + ], "format": Object { "id": "number", "params": Object { @@ -125,9 +128,6 @@ Object { }, "lang": undefined, "name": "area", - "opensearchTypes": Array [ - "geo_shape", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -139,6 +139,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 10, + "esTypes": Array [ + "long", + ], "format": Object { "id": "number", "params": Object { @@ -147,9 +150,6 @@ Object { }, "lang": undefined, "name": "bytes", - "opensearchTypes": Array [ - "long", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -161,6 +161,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "conflict", + ], "format": Object { "id": "number", "params": Object { @@ -169,9 +172,6 @@ Object { }, "lang": undefined, "name": "custom_user_field", - "opensearchTypes": Array [ - "conflict", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -183,6 +183,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -191,9 +194,6 @@ Object { }, "lang": undefined, "name": "extension", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -205,6 +205,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "keyword", + ], "format": Object { "id": "number", "params": Object { @@ -213,9 +216,6 @@ Object { }, "lang": undefined, "name": "extension.keyword", - "opensearchTypes": Array [ - "keyword", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -231,6 +231,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "geo_point", + ], "format": Object { "id": "number", "params": Object { @@ -239,9 +242,6 @@ Object { }, "lang": undefined, "name": "geo.coordinates", - "opensearchTypes": Array [ - "geo_point", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -253,6 +253,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "keyword", + ], "format": Object { "id": "number", "params": Object { @@ -261,9 +264,6 @@ Object { }, "lang": undefined, "name": "geo.src", - "opensearchTypes": Array [ - "keyword", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -275,6 +275,9 @@ Object { "aggregatable": false, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "murmur3", + ], "format": Object { "id": "number", "params": Object { @@ -283,9 +286,6 @@ Object { }, "lang": undefined, "name": "hashed", - "opensearchTypes": Array [ - "murmur3", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -297,6 +297,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "ip", + ], "format": Object { "id": "number", "params": Object { @@ -305,9 +308,6 @@ Object { }, "lang": undefined, "name": "ip", - "opensearchTypes": Array [ - "ip", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -319,6 +319,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -327,9 +330,6 @@ Object { }, "lang": undefined, "name": "machine.os", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -341,6 +341,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "keyword", + ], "format": Object { "id": "number", "params": Object { @@ -349,9 +352,6 @@ Object { }, "lang": undefined, "name": "machine.os.raw", - "opensearchTypes": Array [ - "keyword", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -367,6 +367,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -375,9 +378,6 @@ Object { }, "lang": undefined, "name": "non-filterable", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -389,6 +389,9 @@ Object { "aggregatable": false, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -397,9 +400,6 @@ Object { }, "lang": undefined, "name": "non-sortable", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": undefined, "scripted": false, @@ -411,6 +411,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "integer", + ], "format": Object { "id": "number", "params": Object { @@ -419,9 +422,6 @@ Object { }, "lang": undefined, "name": "phpmemory", - "opensearchTypes": Array [ - "integer", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -433,6 +433,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "geo_point", + ], "format": Object { "id": "number", "params": Object { @@ -441,9 +444,6 @@ Object { }, "lang": undefined, "name": "point", - "opensearchTypes": Array [ - "geo_point", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -455,6 +455,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "attachment", + ], "format": Object { "id": "number", "params": Object { @@ -463,9 +466,6 @@ Object { }, "lang": undefined, "name": "request_body", - "opensearchTypes": Array [ - "attachment", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -477,6 +477,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "date", + ], "format": Object { "id": "number", "params": Object { @@ -485,9 +488,6 @@ Object { }, "lang": "painless", "name": "script date", - "opensearchTypes": Array [ - "date", - ], "readFromDocValues": false, "script": "1234", "scripted": true, @@ -499,6 +499,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "murmur3", + ], "format": Object { "id": "number", "params": Object { @@ -507,9 +510,6 @@ Object { }, "lang": "expression", "name": "script murmur3", - "opensearchTypes": Array [ - "murmur3", - ], "readFromDocValues": false, "script": "1234", "scripted": true, @@ -521,6 +521,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "long", + ], "format": Object { "id": "number", "params": Object { @@ -529,9 +532,6 @@ Object { }, "lang": "expression", "name": "script number", - "opensearchTypes": Array [ - "long", - ], "readFromDocValues": false, "script": "1234", "scripted": true, @@ -543,6 +543,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "text", + ], "format": Object { "id": "number", "params": Object { @@ -551,9 +554,6 @@ Object { }, "lang": "expression", "name": "script string", - "opensearchTypes": Array [ - "text", - ], "readFromDocValues": false, "script": "'i am a string'", "scripted": true, @@ -565,6 +565,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 20, + "esTypes": Array [ + "boolean", + ], "format": Object { "id": "number", "params": Object { @@ -573,9 +576,6 @@ Object { }, "lang": undefined, "name": "ssl", - "opensearchTypes": Array [ - "boolean", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -587,6 +587,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 30, + "esTypes": Array [ + "date", + ], "format": Object { "id": "number", "params": Object { @@ -595,9 +598,6 @@ Object { }, "lang": undefined, "name": "time", - "opensearchTypes": Array [ - "date", - ], "readFromDocValues": true, "script": undefined, "scripted": false, @@ -609,6 +609,9 @@ Object { "aggregatable": true, "conflictDescriptions": undefined, "count": 0, + "esTypes": Array [ + "date", + ], "format": Object { "id": "number", "params": Object { @@ -617,9 +620,6 @@ Object { }, "lang": undefined, "name": "utc_time", - "opensearchTypes": Array [ - "date", - ], "readFromDocValues": true, "script": undefined, "scripted": false, diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts index 594b65fa19cd..ce53461c1de7 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts @@ -190,7 +190,7 @@ export class IndexPattern implements IIndexPattern { return { field: dateField.name, format: - dateField.opensearchTypes && dateField.opensearchTypes.indexOf('date_nanos') !== -1 + dateField.esTypes && dateField.esTypes.indexOf('date_nanos') !== -1 ? 'strict_date_time' : 'date_time', }; @@ -314,11 +314,7 @@ export class IndexPattern implements IIndexPattern { isTimeNanosBased(): boolean { const timeField: any = this.getTimeField(); - return ( - timeField && - timeField.opensearchTypes && - timeField.opensearchTypes.indexOf('date_nanos') !== -1 - ); + return timeField && timeField.esTypes && timeField.esTypes.indexOf('date_nanos') !== -1; } getTimeField() { @@ -374,7 +370,7 @@ export class IndexPattern implements IIndexPattern { this.fieldFormatMap[field.name] || this.fieldFormats.getDefaultInstance( field.type as OSD_FIELD_TYPES, - field.opensearchTypes as OPENSEARCH_FIELD_TYPES[] + field.esTypes as OPENSEARCH_FIELD_TYPES[] ) ); } diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/index_patterns/types.ts index d4a68eba2018..a9f934fa8634 100644 --- a/src/plugins/data/common/index_patterns/types.ts +++ b/src/plugins/data/common/index_patterns/types.ts @@ -156,7 +156,7 @@ export interface FieldSpecExportFmt { conflictDescriptions?: FieldSpecConflictDescriptions; name: string; type: OSD_FIELD_TYPES; - opensearchTypes?: string[]; + esTypes?: string[]; scripted: boolean; searchable: boolean; aggregatable: boolean; @@ -175,7 +175,7 @@ export interface FieldSpec { name: string; type: string; - opensearchTypes?: string[]; + esTypes?: string[]; scripted?: boolean; searchable: boolean; aggregatable: boolean; diff --git a/src/plugins/data/common/opensearch_query/__fixtures__/index_pattern_response.ts b/src/plugins/data/common/opensearch_query/__fixtures__/index_pattern_response.ts index c43dd618df0b..2c5a43696322 100644 --- a/src/plugins/data/common/opensearch_query/__fixtures__/index_pattern_response.ts +++ b/src/plugins/data/common/opensearch_query/__fixtures__/index_pattern_response.ts @@ -37,7 +37,7 @@ export const indexPatternResponse = { { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], count: 10, scripted: false, searchable: true, @@ -47,7 +47,7 @@ export const indexPatternResponse = { { name: 'ssl', type: 'boolean', - opensearchTypes: ['boolean'], + esTypes: ['boolean'], count: 20, scripted: false, searchable: true, @@ -57,7 +57,7 @@ export const indexPatternResponse = { { name: '@timestamp', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 30, scripted: false, searchable: true, @@ -67,7 +67,7 @@ export const indexPatternResponse = { { name: 'time', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 30, scripted: false, searchable: true, @@ -77,7 +77,7 @@ export const indexPatternResponse = { { name: '@tags', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -87,7 +87,7 @@ export const indexPatternResponse = { { name: 'utc_time', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 0, scripted: false, searchable: true, @@ -97,7 +97,7 @@ export const indexPatternResponse = { { name: 'phpmemory', type: 'number', - opensearchTypes: ['integer'], + esTypes: ['integer'], count: 0, scripted: false, searchable: true, @@ -107,7 +107,7 @@ export const indexPatternResponse = { { name: 'ip', type: 'ip', - opensearchTypes: ['ip'], + esTypes: ['ip'], count: 0, scripted: false, searchable: true, @@ -117,7 +117,7 @@ export const indexPatternResponse = { { name: 'request_body', type: 'attachment', - opensearchTypes: ['attachment'], + esTypes: ['attachment'], count: 0, scripted: false, searchable: true, @@ -127,7 +127,7 @@ export const indexPatternResponse = { { name: 'point', type: 'geo_point', - opensearchTypes: ['geo_point'], + esTypes: ['geo_point'], count: 0, scripted: false, searchable: true, @@ -137,7 +137,7 @@ export const indexPatternResponse = { { name: 'area', type: 'geo_shape', - opensearchTypes: ['geo_shape'], + esTypes: ['geo_shape'], count: 0, scripted: false, searchable: true, @@ -147,7 +147,7 @@ export const indexPatternResponse = { { name: 'hashed', type: 'murmur3', - opensearchTypes: ['murmur3'], + esTypes: ['murmur3'], count: 0, scripted: false, searchable: true, @@ -157,7 +157,7 @@ export const indexPatternResponse = { { name: 'geo.coordinates', type: 'geo_point', - opensearchTypes: ['geo_point'], + esTypes: ['geo_point'], count: 0, scripted: false, searchable: true, @@ -167,7 +167,7 @@ export const indexPatternResponse = { { name: 'extension', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -177,7 +177,7 @@ export const indexPatternResponse = { { name: 'machine.os', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, @@ -187,7 +187,7 @@ export const indexPatternResponse = { { name: 'machine.os.raw', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -198,7 +198,7 @@ export const indexPatternResponse = { { name: 'geo.src', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -208,7 +208,7 @@ export const indexPatternResponse = { { name: '_id', type: 'string', - opensearchTypes: ['_id'], + esTypes: ['_id'], count: 0, scripted: false, searchable: true, @@ -218,7 +218,7 @@ export const indexPatternResponse = { { name: '_type', type: 'string', - opensearchTypes: ['_type'], + esTypes: ['_type'], count: 0, scripted: false, searchable: true, @@ -228,7 +228,7 @@ export const indexPatternResponse = { { name: '_source', type: '_source', - opensearchTypes: ['_source'], + esTypes: ['_source'], count: 0, scripted: false, searchable: true, @@ -238,7 +238,7 @@ export const indexPatternResponse = { { name: 'non-filterable', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: false, @@ -248,7 +248,7 @@ export const indexPatternResponse = { { name: 'non-sortable', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: false, @@ -258,7 +258,7 @@ export const indexPatternResponse = { { name: 'custom_user_field', type: 'conflict', - opensearchTypes: ['long', 'text'], + esTypes: ['long', 'text'], count: 0, scripted: false, searchable: true, @@ -312,7 +312,7 @@ export const indexPatternResponse = { { name: 'nestedField.child', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, @@ -323,7 +323,7 @@ export const indexPatternResponse = { { name: 'nestedField.nestedChild.doublyNestedChild', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 0, scripted: false, searchable: true, diff --git a/src/plugins/data/common/osd_field_types/osd_field_type.ts b/src/plugins/data/common/osd_field_types/osd_field_type.ts index bd75dbdb07ea..c22f498703c5 100644 --- a/src/plugins/data/common/osd_field_types/osd_field_type.ts +++ b/src/plugins/data/common/osd_field_types/osd_field_type.ts @@ -36,12 +36,12 @@ export class OsdFieldType { public readonly name: string; public readonly sortable: boolean; public readonly filterable: boolean; - public readonly opensearchTypes: readonly OPENSEARCH_FIELD_TYPES[]; + public readonly esTypes: readonly OPENSEARCH_FIELD_TYPES[]; constructor(options: Partial = {}) { this.name = options.name || OSD_FIELD_TYPES.UNKNOWN; this.sortable = options.sortable || false; this.filterable = options.filterable || false; - this.opensearchTypes = Object.freeze((options.opensearchTypes || []).slice()); + this.esTypes = Object.freeze((options.esTypes || []).slice()); } } diff --git a/src/plugins/data/common/osd_field_types/osd_field_types.test.ts b/src/plugins/data/common/osd_field_types/osd_field_types.test.ts index af5cd04bb7cf..f8f09d49afef 100644 --- a/src/plugins/data/common/osd_field_types/osd_field_types.test.ts +++ b/src/plugins/data/common/osd_field_types/osd_field_types.test.ts @@ -47,25 +47,25 @@ describe('utils/osd_field_types', () => { expect(osdFieldType).toHaveProperty('name', OSD_FIELD_TYPES.UNKNOWN); expect(osdFieldType).toHaveProperty('sortable', false); expect(osdFieldType).toHaveProperty('filterable', false); - expect(osdFieldType.opensearchTypes).toEqual([]); + expect(osdFieldType.esTypes).toEqual([]); }); - test('assigns name, sortable, filterable, and opensearchTypes options to itself', () => { + test('assigns name, sortable, filterable, and esTypes options to itself', () => { const name = 'name'; const sortable = true; const filterable = true; - const opensearchTypes = [ + const esTypes = [ OPENSEARCH_FIELD_TYPES.LONG, OPENSEARCH_FIELD_TYPES.BYTE, OPENSEARCH_FIELD_TYPES.DATE, ]; - const osdFieldType = new OsdFieldType({ name, sortable, filterable, opensearchTypes }); + const osdFieldType = new OsdFieldType({ name, sortable, filterable, esTypes }); expect(osdFieldType).toHaveProperty('name', name); expect(osdFieldType).toHaveProperty('sortable', sortable); expect(osdFieldType).toHaveProperty('filterable', filterable); - expect(osdFieldType.opensearchTypes).toEqual(opensearchTypes); + expect(osdFieldType.esTypes).toEqual(esTypes); }); }); diff --git a/src/plugins/data/common/osd_field_types/osd_field_types.ts b/src/plugins/data/common/osd_field_types/osd_field_types.ts index 393a16e7c9a5..f5f05b462d31 100644 --- a/src/plugins/data/common/osd_field_types/osd_field_types.ts +++ b/src/plugins/data/common/osd_field_types/osd_field_types.ts @@ -47,7 +47,7 @@ export const getOsdFieldType = (typeName: string): OsdFieldType => registeredOsdTypes.find((t) => t.name === typeName) || OsdFieldTypeUnknown; /** - * Get the opensearchTypes known by all osdFieldTypes + * Get the esTypes known by all osdFieldTypes * * @return {Array} */ @@ -64,7 +64,7 @@ export const castOpenSearchToOsdFieldTypeName = ( opensearchType: OPENSEARCH_FIELD_TYPES | string ): OSD_FIELD_TYPES => { const type = registeredOsdTypes.find((t) => - t.opensearchTypes.includes(opensearchType as OPENSEARCH_FIELD_TYPES) + t.esTypes.includes(opensearchType as OPENSEARCH_FIELD_TYPES) ); return type && type.name ? (type.name as OSD_FIELD_TYPES) : OSD_FIELD_TYPES.UNKNOWN; diff --git a/src/plugins/data/common/osd_field_types/osd_field_types_factory.ts b/src/plugins/data/common/osd_field_types/osd_field_types_factory.ts index 2ff94795f7a1..3188dd42ab38 100644 --- a/src/plugins/data/common/osd_field_types/osd_field_types_factory.ts +++ b/src/plugins/data/common/osd_field_types/osd_field_types_factory.ts @@ -42,7 +42,7 @@ export const createOsdFieldTypes = (): OsdFieldType[] => [ name: OSD_FIELD_TYPES.STRING, sortable: true, filterable: true, - opensearchTypes: [ + esTypes: [ OPENSEARCH_FIELD_TYPES.STRING, OPENSEARCH_FIELD_TYPES.TEXT, OPENSEARCH_FIELD_TYPES.KEYWORD, @@ -54,7 +54,7 @@ export const createOsdFieldTypes = (): OsdFieldType[] => [ name: OSD_FIELD_TYPES.NUMBER, sortable: true, filterable: true, - opensearchTypes: [ + esTypes: [ OPENSEARCH_FIELD_TYPES.FLOAT, OPENSEARCH_FIELD_TYPES.HALF_FLOAT, OPENSEARCH_FIELD_TYPES.SCALED_FLOAT, @@ -71,52 +71,52 @@ export const createOsdFieldTypes = (): OsdFieldType[] => [ name: OSD_FIELD_TYPES.DATE, sortable: true, filterable: true, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.DATE, OPENSEARCH_FIELD_TYPES.DATE_NANOS], + esTypes: [OPENSEARCH_FIELD_TYPES.DATE, OPENSEARCH_FIELD_TYPES.DATE_NANOS], }), new OsdFieldType({ name: OSD_FIELD_TYPES.IP, sortable: true, filterable: true, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.IP], + esTypes: [OPENSEARCH_FIELD_TYPES.IP], }), new OsdFieldType({ name: OSD_FIELD_TYPES.BOOLEAN, sortable: true, filterable: true, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.BOOLEAN], + esTypes: [OPENSEARCH_FIELD_TYPES.BOOLEAN], }), new OsdFieldType({ name: OSD_FIELD_TYPES.OBJECT, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.OBJECT], + esTypes: [OPENSEARCH_FIELD_TYPES.OBJECT], }), new OsdFieldType({ name: OSD_FIELD_TYPES.NESTED, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.NESTED], + esTypes: [OPENSEARCH_FIELD_TYPES.NESTED], }), new OsdFieldType({ name: OSD_FIELD_TYPES.GEO_POINT, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.GEO_POINT], + esTypes: [OPENSEARCH_FIELD_TYPES.GEO_POINT], }), new OsdFieldType({ name: OSD_FIELD_TYPES.GEO_SHAPE, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.GEO_SHAPE], + esTypes: [OPENSEARCH_FIELD_TYPES.GEO_SHAPE], }), new OsdFieldType({ name: OSD_FIELD_TYPES.ATTACHMENT, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.ATTACHMENT], + esTypes: [OPENSEARCH_FIELD_TYPES.ATTACHMENT], }), new OsdFieldType({ name: OSD_FIELD_TYPES.MURMUR3, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.MURMUR3], + esTypes: [OPENSEARCH_FIELD_TYPES.MURMUR3], }), new OsdFieldType({ name: OSD_FIELD_TYPES._SOURCE, - opensearchTypes: [OPENSEARCH_FIELD_TYPES._SOURCE], + esTypes: [OPENSEARCH_FIELD_TYPES._SOURCE], }), new OsdFieldType({ name: OSD_FIELD_TYPES.HISTOGRAM, filterable: true, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.HISTOGRAM], + esTypes: [OPENSEARCH_FIELD_TYPES.HISTOGRAM], }), new OsdFieldType({ name: OSD_FIELD_TYPES.CONFLICT, diff --git a/src/plugins/data/common/osd_field_types/types.ts b/src/plugins/data/common/osd_field_types/types.ts index 1e32ea1cf5ec..ab6d7e787f07 100644 --- a/src/plugins/data/common/osd_field_types/types.ts +++ b/src/plugins/data/common/osd_field_types/types.ts @@ -35,7 +35,7 @@ export interface OsdFieldTypeOptions { sortable: boolean; filterable: boolean; name: string; - opensearchTypes: OPENSEARCH_FIELD_TYPES[]; + esTypes: OPENSEARCH_FIELD_TYPES[]; } /** @public **/ diff --git a/src/plugins/data/common/query/timefilter/get_time.test.ts b/src/plugins/data/common/query/timefilter/get_time.test.ts index 1742d19fa94f..2df8c3dbcd5f 100644 --- a/src/plugins/data/common/query/timefilter/get_time.test.ts +++ b/src/plugins/data/common/query/timefilter/get_time.test.ts @@ -48,7 +48,7 @@ describe('get_time', () => { { name: 'date', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], aggregatable: true, searchable: true, filterable: true, @@ -77,7 +77,7 @@ describe('get_time', () => { { name: 'date', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], aggregatable: true, searchable: true, filterable: true, @@ -85,7 +85,7 @@ describe('get_time', () => { { name: 'myCustomDate', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], aggregatable: true, searchable: true, filterable: true, diff --git a/src/plugins/data/common/search/aggs/buckets/histogram.ts b/src/plugins/data/common/search/aggs/buckets/histogram.ts index 27e10e48179a..67ee4d11b1e1 100644 --- a/src/plugins/data/common/search/aggs/buckets/histogram.ts +++ b/src/plugins/data/common/search/aggs/buckets/histogram.ts @@ -171,7 +171,7 @@ export const getHistogramBucketAgg = ({ maxBucketsUiSettings: getConfig(UI_SETTINGS.HISTOGRAM_MAX_BARS), maxBucketsUserInput: aggConfig.params.maxBars, intervalBase: aggConfig.params.intervalBase, - opensearchTypes: aggConfig.params.field?.spec?.opensearchTypes || [], + esTypes: aggConfig.params.field?.spec?.esTypes || [], }); }, }, diff --git a/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.test.ts b/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.test.ts index 7ec6465bf99d..8c3b33e81cbc 100644 --- a/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.test.ts @@ -50,7 +50,7 @@ describe('calculateHistogramInterval', () => { min: 0, max: 1, }, - opensearchTypes: [], + esTypes: [], }; }); @@ -63,7 +63,7 @@ describe('calculateHistogramInterval', () => { min: 1, max: 50, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], }; expect(calculateHistogramInterval(p)).toEqual(1); }); @@ -77,7 +77,7 @@ describe('calculateHistogramInterval', () => { min: 521, max: 689, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], }; expect(calculateHistogramInterval(p)).toEqual(1); }); @@ -90,7 +90,7 @@ describe('calculateHistogramInterval', () => { min: 400, max: 790, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER, OPENSEARCH_FIELD_TYPES.SHORT], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER, OPENSEARCH_FIELD_TYPES.SHORT], }; expect(calculateHistogramInterval(p)).toEqual(5); }); @@ -104,7 +104,7 @@ describe('calculateHistogramInterval', () => { min: 567, max: 3456778, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.LONG], + esTypes: [OPENSEARCH_FIELD_TYPES.LONG], }; expect(calculateHistogramInterval(p)).toEqual(50000); }); @@ -117,7 +117,7 @@ describe('calculateHistogramInterval', () => { min: 0, max: 1, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }; expect(calculateHistogramInterval(p)).toEqual(0.01); }); @@ -130,7 +130,7 @@ describe('calculateHistogramInterval', () => { min: 0, max: 1, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER, OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER, OPENSEARCH_FIELD_TYPES.FLOAT], }; expect(calculateHistogramInterval(p)).toEqual(0.01); }); @@ -143,7 +143,7 @@ describe('calculateHistogramInterval', () => { min: 150, max: 250, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.SHORT], + esTypes: [OPENSEARCH_FIELD_TYPES.SHORT], }; expect(calculateHistogramInterval(p)).toEqual(1); }); @@ -157,7 +157,7 @@ describe('calculateHistogramInterval', () => { min: 0.1, max: 0.9, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }) ).toBe(0.02); }); @@ -171,7 +171,7 @@ describe('calculateHistogramInterval', () => { min: 10.45, max: 1000.05, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }) ).toBe(100); }); @@ -186,7 +186,7 @@ describe('calculateHistogramInterval', () => { min: 0, max: 100, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.BYTE], + esTypes: [OPENSEARCH_FIELD_TYPES.BYTE], }) ).toEqual(1); }); @@ -199,7 +199,7 @@ describe('calculateHistogramInterval', () => { min: 1, max: 10, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], }) ).toEqual(1); }); @@ -213,7 +213,7 @@ describe('calculateHistogramInterval', () => { min: 45678, max: 90123, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], }) ).toEqual(500); }); @@ -228,7 +228,7 @@ describe('calculateHistogramInterval', () => { min: 1.245, max: 2.9, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }) ).toEqual(0.02); expect( @@ -238,7 +238,7 @@ describe('calculateHistogramInterval', () => { min: 0.5, max: 2.3, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }) ).toEqual(0.02); }); @@ -252,7 +252,7 @@ describe('calculateHistogramInterval', () => { min: 0.1, max: 0.9, }, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], + esTypes: [OPENSEARCH_FIELD_TYPES.FLOAT], }) ).toBe(0.01); }); diff --git a/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.ts b/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.ts index 2bb684faade8..e67b786a81f1 100644 --- a/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.ts +++ b/src/plugins/data/common/search/aggs/buckets/lib/histogram_calculate_interval.ts @@ -42,7 +42,7 @@ export interface CalculateHistogramIntervalParams { interval: string; maxBucketsUiSettings: number; maxBucketsUserInput?: number | ''; - opensearchTypes: OPENSEARCH_FIELD_TYPES[]; + esTypes: OPENSEARCH_FIELD_TYPES[]; intervalBase?: number; values?: IntervalValuesRange; } @@ -95,7 +95,7 @@ const calculateForGivenInterval = ( const calculateAutoInterval = ( diff: number, maxBars: number, - opensearchTypes: OPENSEARCH_FIELD_TYPES[] + esTypes: OPENSEARCH_FIELD_TYPES[] ) => { const exactInterval = diff / maxBars; @@ -104,7 +104,7 @@ const calculateAutoInterval = ( // see: https://www.opensearch.org/guide/en/elasticsearch/reference/current/number.html if ( diff < maxBars && - opensearchTypes.every((opensearchType) => + esTypes.every((opensearchType) => [ OPENSEARCH_FIELD_TYPES.INTEGER, OPENSEARCH_FIELD_TYPES.LONG, @@ -138,7 +138,7 @@ export const calculateHistogramInterval = ({ maxBucketsUserInput, intervalBase, values, - opensearchTypes, + esTypes, }: CalculateHistogramIntervalParams) => { const isAuto = isAutoInterval(interval); let calculatedInterval = isAuto ? 0 : parseFloat(interval); @@ -158,7 +158,7 @@ export const calculateHistogramInterval = ({ // Mind maxBucketsUserInput can be an empty string, hence we need to ensure it here Math.min(maxBucketsUiSettings, maxBucketsUserInput || maxBucketsUiSettings), - opensearchTypes + esTypes ) : calculateForGivenInterval(diff, calculatedInterval, maxBucketsUiSettings); } diff --git a/src/plugins/data/common/search/aggs/param_types/field.test.ts b/src/plugins/data/common/search/aggs/param_types/field.test.ts index 62de4d3788fd..ff52d4052653 100644 --- a/src/plugins/data/common/search/aggs/param_types/field.test.ts +++ b/src/plugins/data/common/search/aggs/param_types/field.test.ts @@ -43,7 +43,7 @@ describe('Field', () => { { name: 'field1', type: OSD_FIELD_TYPES.NUMBER, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], + esTypes: [OPENSEARCH_FIELD_TYPES.INTEGER], aggregatable: true, filterable: true, searchable: true, @@ -51,7 +51,7 @@ describe('Field', () => { { name: 'field2', type: OSD_FIELD_TYPES.STRING, - opensearchTypes: [OPENSEARCH_FIELD_TYPES.TEXT], + esTypes: [OPENSEARCH_FIELD_TYPES.TEXT], aggregatable: false, filterable: false, searchable: true, diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index b22666494b82..741f89b434d0 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -768,7 +768,7 @@ export interface IFieldType { // (undocumented) name: string; // (undocumented) - opensearchTypes?: string[]; + esTypes?: string[]; // (undocumented) readFromDocValues?: boolean; // (undocumented) @@ -1011,7 +1011,7 @@ export class IndexPatternField implements IFieldType { // (undocumented) get name(): string; // (undocumented) - get opensearchTypes(): string[] | undefined; + get esTypes(): string[] | undefined; // (undocumented) get readFromDocValues(): boolean; get script(): string | undefined; @@ -1034,7 +1034,7 @@ export class IndexPatternField implements IFieldType { conflictDescriptions: Record | undefined; name: string; type: string; - opensearchTypes: string[] | undefined; + esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; diff --git a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx index 23d01c4fe115..b44e7abad793 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx @@ -84,7 +84,7 @@ const mockIndexPattern = { { name: 'response', type: 'number', - opensearchTypes: ['integer'], + esTypes: ['integer'], aggregatable: true, filterable: true, searchable: true, diff --git a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts b/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts index 5ed6531fd4ca..e785bdb1cc09 100644 --- a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts +++ b/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts @@ -40,7 +40,7 @@ export interface FieldDescriptor { readFromDocValues: boolean; searchable: boolean; type: string; - opensearchTypes: string[]; + esTypes: string[]; subType?: FieldSubType; } diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js index 3b281b568014..982ccf860cc3 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js +++ b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js @@ -54,7 +54,7 @@ describe('index_patterns/field_capabilities/field_caps_response', () => { }); it( - 'includes only name, type, opensearchTypes, searchable, aggregatable, readFromDocValues, and maybe conflictDescriptions, ' + + 'includes only name, type, esTypes, searchable, aggregatable, readFromDocValues, and maybe conflictDescriptions, ' + 'and subType of each field', () => { const responseClone = cloneDeep(opensearchResponse); @@ -68,7 +68,7 @@ describe('index_patterns/field_capabilities/field_caps_response', () => { expect(Object.keys(fieldWithoutOptionalKeys)).toEqual([ 'name', 'type', - 'opensearchTypes', + 'esTypes', 'searchable', 'aggregatable', 'readFromDocValues', @@ -97,7 +97,7 @@ describe('index_patterns/field_capabilities/field_caps_response', () => { const fields = readFieldCapsResponse(opensearchResponse); fields.forEach((field) => { const fixtureTypes = Object.keys(opensearchResponse.fields[field.name]); - expect(field.opensearchTypes).toEqual(fixtureTypes); + expect(field.esTypes).toEqual(fixtureTypes); }); }); @@ -108,7 +108,7 @@ describe('index_patterns/field_capabilities/field_caps_response', () => { { name: 'success', type: 'conflict', - opensearchTypes: ['boolean', 'keyword'], + esTypes: ['boolean', 'keyword'], searchable: true, aggregatable: true, readFromDocValues: false, diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts index 84dfebaebea1..0af5a2f726ce 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts +++ b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts @@ -139,7 +139,7 @@ export function readFieldCapsResponse(fieldCapsResponse: FieldCapsResponse): Fie const field = { name: fieldName, type: 'conflict', - opensearchTypes: types, + esTypes: types, searchable: isSearchable, aggregatable: isAggregatable, readFromDocValues: false, @@ -161,7 +161,7 @@ export function readFieldCapsResponse(fieldCapsResponse: FieldCapsResponse): Fie const field = { name: fieldName, type: castOpenSearchToOsdFieldTypeName(opensearchType), - opensearchTypes: types, + esTypes: types, searchable: isSearchable, aggregatable: isAggregatable, readFromDocValues: shouldReadFieldFromDocValues(isAggregatable, opensearchType), diff --git a/src/plugins/data/server/plugins_data_server.api.md b/src/plugins/data/server/plugins_data_server.api.md index a1724b190e2b..3005f9cdedb2 100644 --- a/src/plugins/data/server/plugins_data_server.api.md +++ b/src/plugins/data/server/plugins_data_server.api.md @@ -342,7 +342,7 @@ export interface IFieldType { // (undocumented) displayName?: string; // (undocumented) - opensearchTypes?: string[]; + esTypes?: string[]; // (undocumented) filterable?: boolean; // (undocumented) @@ -415,7 +415,7 @@ export interface IndexPatternFieldDescriptor { // (undocumented) aggregatable: boolean; // (undocumented) - opensearchTypes: string[]; + esTypes: string[]; // (undocumented) name: string; // (undocumented) diff --git a/src/plugins/data/server/saved_objects/index_pattern_migrations.test.ts b/src/plugins/data/server/saved_objects/index_pattern_migrations.test.ts index 52e82d354ce0..cec537667cb8 100644 --- a/src/plugins/data/server/saved_objects/index_pattern_migrations.test.ts +++ b/src/plugins/data/server/saved_objects/index_pattern_migrations.test.ts @@ -92,7 +92,7 @@ Object { attributes: { title: 'test', fields: - '[{"name":"customer_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":"multi","parent":"customer_name"}]', + '[{"name":"customer_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":"multi","parent":"customer_name"}]', }, }; const expected = { @@ -100,7 +100,7 @@ Object { attributes: { title: 'test', fields: - '[{"name":"customer_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_name"}}}]', + '[{"name":"customer_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_name"}}}]', }, }; diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index f501ba25b200..2c066808b3db 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -164,7 +164,7 @@ interface FieldDescriptor { // (undocumented) name: string; // (undocumented) - opensearchTypes: string[]; + esTypes: string[]; // (undocumented) readFromDocValues: boolean; // (undocumented) @@ -333,7 +333,7 @@ export interface IFieldType { // (undocumented) name: string; // (undocumented) - opensearchTypes?: string[]; + esTypes?: string[]; // (undocumented) readFromDocValues?: boolean; // (undocumented) diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx index 11b026c1af7f..b0ba2873fae9 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx @@ -89,7 +89,7 @@ function getComponent({ { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], count: 10, scripted: false, searchable: true, @@ -135,7 +135,7 @@ describe('discover sidebar field', function () { { name: '_source', type: '_source', - opensearchTypes: ['_source'], + esTypes: ['_source'], searchable: true, aggregatable: true, readFromDocValues: true, diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx index 51ae9c0990cc..a1d0bc2cca39 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx @@ -65,7 +65,7 @@ describe('discover sidebar field details', function () { { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], count: 10, scripted: false, searchable: true, @@ -83,7 +83,7 @@ describe('discover sidebar field details', function () { { name: '_id', type: 'string', - opensearchTypes: ['_id'], + esTypes: ['_id'], count: 0, scripted: false, searchable: true, @@ -101,7 +101,7 @@ describe('discover sidebar field details', function () { { name: 'test', type: 'unknown', - opensearchTypes: ['double'], + esTypes: ['double'], count: 0, scripted: false, searchable: true, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts index 45fe2b41dbde..5cb0da4af248 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts +++ b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts @@ -73,7 +73,7 @@ describe('field_filter', function () { { name: 'bytes', type: 'number', - opensearchTypes: ['long'], + esTypes: ['long'], count: 10, scripted: false, searchable: false, @@ -82,7 +82,7 @@ describe('field_filter', function () { { name: 'extension', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 10, scripted: true, searchable: true, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts index 855f18e54010..793154a78c9a 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts +++ b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts @@ -39,7 +39,7 @@ describe('group_fields', function () { { name: 'category', type: 'string', - opensearchTypes: ['text'], + esTypes: ['text'], count: 1, scripted: false, searchable: true, @@ -49,7 +49,7 @@ describe('group_fields', function () { { name: 'currency', type: 'string', - opensearchTypes: ['keyword'], + esTypes: ['keyword'], count: 0, scripted: false, searchable: true, @@ -59,7 +59,7 @@ describe('group_fields', function () { { name: 'customer_birth_date', type: 'date', - opensearchTypes: ['date'], + esTypes: ['date'], count: 0, scripted: false, searchable: true, @@ -83,10 +83,10 @@ describe('group_fields', function () { Object { "aggregatable": true, "count": 1, - "name": "category", - "opensearchTypes": Array [ + "esTypes": Array [ "text", ], + "name": "category", "readFromDocValues": true, "scripted": false, "searchable": true, @@ -97,10 +97,10 @@ describe('group_fields', function () { Object { "aggregatable": true, "count": 0, - "name": "currency", - "opensearchTypes": Array [ + "esTypes": Array [ "keyword", ], + "name": "currency", "readFromDocValues": true, "scripted": false, "searchable": true, @@ -111,10 +111,10 @@ describe('group_fields', function () { Object { "aggregatable": true, "count": 0, - "name": "customer_birth_date", - "opensearchTypes": Array [ + "esTypes": Array [ "date", ], + "name": "customer_birth_date", "readFromDocValues": true, "scripted": false, "searchable": true, diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts index d36eea5d15f6..427b36aa5857 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts @@ -309,7 +309,7 @@ export const getSavedObjects = (): SavedObject[] => [ title: 'opensearch_dashboards_sample_data_ecommerce', timeFieldName: 'order_date', fields: - '[{"name":"_id","type":"string","opensearchTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","opensearchTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","opensearchTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","opensearchTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"category","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"category.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"category"}}},{"name":"currency","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_birth_date","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_first_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_first_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_first_name"}}},{"name":"customer_full_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_full_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_full_name"}}},{"name":"customer_gender","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_id","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_last_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_last_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_last_name"}}},{"name":"customer_phone","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"day_of_week","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"day_of_week_i","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"email","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.city_name","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.continent_name","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.country_iso_code","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.location","type":"geo_point","opensearchTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.region_name","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"manufacturer","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"manufacturer.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"manufacturer"}}},{"name":"order_date","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"order_id","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products._id","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products._id.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products._id"}}},{"name":"products.base_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.base_unit_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.category","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.category.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.category"}}},{"name":"products.created_on","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.discount_amount","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.discount_percentage","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.manufacturer","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.manufacturer.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.manufacturer"}}},{"name":"products.min_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.product_id","type":"number","opensearchTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.product_name","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.product_name.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.product_name"}}},{"name":"products.quantity","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.sku","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.tax_amount","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.taxful_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.taxless_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.unit_discount_amount","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"sku","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"taxful_total_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"taxless_total_price","type":"number","opensearchTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"total_quantity","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"total_unique_products","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"type","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"user","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]', + '[{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"category","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"category.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"category"}}},{"name":"currency","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_birth_date","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_first_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_first_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_first_name"}}},{"name":"customer_full_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_full_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_full_name"}}},{"name":"customer_gender","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_id","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"customer_last_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"customer_last_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"customer_last_name"}}},{"name":"customer_phone","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"day_of_week","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"day_of_week_i","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"email","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.city_name","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.continent_name","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.country_iso_code","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.location","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geoip.region_name","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"manufacturer","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"manufacturer.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"manufacturer"}}},{"name":"order_date","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"order_id","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products._id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products._id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products._id"}}},{"name":"products.base_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.base_unit_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.category","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.category.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.category"}}},{"name":"products.created_on","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.discount_amount","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.discount_percentage","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.manufacturer","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.manufacturer.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.manufacturer"}}},{"name":"products.min_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.product_id","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.product_name","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"products.product_name.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"products.product_name"}}},{"name":"products.quantity","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.sku","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.tax_amount","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.taxful_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.taxless_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"products.unit_discount_amount","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"sku","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"taxful_total_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"taxless_total_price","type":"number","esTypes":["half_float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"total_quantity","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"total_unique_products","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"type","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"user","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]', fieldFormatMap: '{"taxful_total_price":{"id":"number","params":{"pattern":"$0,0.[00]"}}}', }, references: [], diff --git a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts index f17e4ecf1027..b34d97e20da0 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts @@ -453,7 +453,7 @@ export const getSavedObjects = (): SavedObject[] => [ title: 'opensearch_dashboards_sample_data_flights', timeFieldName: 'timestamp', fields: - '[{"name":"AvgTicketPrice","type":"number","opensearchTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Cancelled","type":"boolean","opensearchTypes":["boolean"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Carrier","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Dest","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestAirportID","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestCityName","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestCountry","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestLocation","type":"geo_point","opensearchTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestRegion","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestWeather","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DistanceKilometers","type":"number","opensearchTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DistanceMiles","type":"number","opensearchTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelay","type":"boolean","opensearchTypes":["boolean"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelayMin","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelayType","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightNum","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightTimeHour","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightTimeMin","type":"number","opensearchTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Origin","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginAirportID","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginCityName","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginCountry","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginLocation","type":"geo_point","opensearchTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginRegion","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginWeather","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","opensearchTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","opensearchTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","opensearchTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","opensearchTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"dayOfWeek","type":"number","opensearchTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"timestamp","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.hourOfDay","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', + '[{"name":"AvgTicketPrice","type":"number","esTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Cancelled","type":"boolean","esTypes":["boolean"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Carrier","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Dest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestAirportID","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestCityName","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestCountry","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestLocation","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestRegion","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DestWeather","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DistanceKilometers","type":"number","esTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"DistanceMiles","type":"number","esTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelay","type":"boolean","esTypes":["boolean"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelayMin","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightDelayType","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightNum","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightTimeHour","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"FlightTimeMin","type":"number","esTypes":["float"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"Origin","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginAirportID","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginCityName","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginCountry","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginLocation","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginRegion","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"OriginWeather","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"dayOfWeek","type":"number","esTypes":["integer"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.hourOfDay","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', fieldFormatMap: '{"hour_of_day":{"id":"number","params":{"pattern":"00"}},"AvgTicketPrice":{"id":"number","params":{"pattern":"$0,0.[00]"}}}', }, diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index 9a21941bb317..49ea6ecae8bb 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -284,7 +284,7 @@ export const getSavedObjects = (): SavedObject[] => [ title: 'opensearch_dashboards_sample_data_logs', timeFieldName: 'timestamp', fields: - '[{"name":"@timestamp","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","opensearchTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","opensearchTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","opensearchTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","opensearchTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"agent","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"agent.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "agent"}}},{"name":"bytes","type":"number","opensearchTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"clientip","type":"ip","opensearchTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"extension","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"extension.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "extension"}}},{"name":"geo.coordinates","type":"geo_point","opensearchTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.dest","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.src","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.srcdest","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"host","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"host.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "host"}}},{"name":"index","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"index.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "index"}}},{"name":"ip","type":"ip","opensearchTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"machine.os","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine.os.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "machine.os"}}},{"name":"machine.ram","type":"number","opensearchTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"memory","type":"number","opensearchTypes":["double"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"message","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "message"}}},{"name":"phpmemory","type":"number","opensearchTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"referer","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"request","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"request.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "request"}}},{"name":"response","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"response.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "response"}}},{"name":"tags","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tags.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "tags"}}},{"name":"timestamp","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","opensearchTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","opensearchTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "url"}}},{"name":"utc_time","type":"date","opensearchTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', + '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"agent","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"agent.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "agent"}}},{"name":"bytes","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"clientip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"extension","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"extension.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "extension"}}},{"name":"geo.coordinates","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.dest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.src","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.srcdest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"host","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"host.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "host"}}},{"name":"index","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"index.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "index"}}},{"name":"ip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"machine.os","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine.os.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "machine.os"}}},{"name":"machine.ram","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"memory","type":"number","esTypes":["double"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "message"}}},{"name":"phpmemory","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"referer","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"request","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"request.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "request"}}},{"name":"response","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"response.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "response"}}},{"name":"tags","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tags.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "tags"}}},{"name":"timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent": "url"}}},{"name":"utc_time","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', fieldFormatMap: '{"hour_of_day":{}}', }, references: [], diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx index 647df61687ff..b9cfa5d82d32 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx +++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx @@ -206,7 +206,7 @@ export class FieldEditor extends PureComponent