diff --git a/src/mappings/definitions/premap.ts b/src/mappings/definitions/premap.ts index f7be4a18..ebe4fe07 100644 --- a/src/mappings/definitions/premap.ts +++ b/src/mappings/definitions/premap.ts @@ -39,6 +39,9 @@ export const premaps: ElasticsearchPremap = { tree: 'quadtree', type: ElasticsearchDataType.geo_shape, }, + SCISO8601DateRange: { + type: ElasticsearchDataType.date_range, + }, 'jsonpatch.OpPatch': { dynamic: 'strict', properties: { diff --git a/src/mappings/definitions/typemap.ts b/src/mappings/definitions/typemap.ts index 4235788e..dd5b82ef 100644 --- a/src/mappings/definitions/typemap.ts +++ b/src/mappings/definitions/typemap.ts @@ -32,6 +32,12 @@ export enum ElasticsearchDataType { geo_point = 'geo_point', geo_shape = 'geo_shape', completion = 'completion', + date_range = 'date_rage', + // integer_range = 'integer_range', + // float_range = 'float_range', + // long_range = 'long_range', + // double_range = 'double_range', + // ip_range = 'ip_range', } export const typemap: ElasticsearchTypemap = { @@ -45,11 +51,13 @@ export const typemap: ElasticsearchTypemap = { default: ElasticsearchDataType.integer, float: ElasticsearchDataType.float, integer: ElasticsearchDataType.integer, + date: ElasticsearchDataType.date, }, string: { default: ElasticsearchDataType.text, keyword: ElasticsearchDataType.keyword, text: ElasticsearchDataType.text, + date: ElasticsearchDataType.date, }, stringLiteral: { default: ElasticsearchDataType.keyword, diff --git a/test/mapping-model/mappings/src/map-explicit-types.ts b/test/mapping-model/mappings/src/map-explicit-types.ts index a5b394f2..093a454a 100644 --- a/test/mapping-model/mappings/src/map-explicit-types.ts +++ b/test/mapping-model/mappings/src/map-explicit-types.ts @@ -42,6 +42,16 @@ export interface MapExplicitTypes { */ esText: string; + /** + * @date + */ + esEpochMsDate: number + + /** + * @date + */ + esStringDate: string + type: ThingType.MapExplicitTypes; } @@ -60,7 +70,13 @@ export const mapExplicitTypesTest: MapAggTestOptions = { }, esText: { type: ElasticsearchDataType.text - } + }, + esEpochMsDate: { + type: ElasticsearchDataType.date + }, + esStringDate: { + type: ElasticsearchDataType.date + }, } } };