From f4893f137554fe06054cbf73720990b98cad71cb Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 Jan 2025 14:41:42 +0400 Subject: [PATCH] Add passthrough mapping type --- output/openapi/elasticsearch-openapi.json | 30 +++++++ .../elasticsearch-serverless-openapi.json | 30 +++++++ output/schema/schema-serverless.json | 81 +++++++++++++++++-- output/schema/schema.json | 81 +++++++++++++++++-- output/typescript/types.ts | 11 ++- specification/_types/mapping/Property.ts | 5 +- specification/_types/mapping/complex.ts | 7 ++ 7 files changed, 228 insertions(+), 17 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 1278f6ef2d..2e76f59592 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -60441,6 +60441,9 @@ { "$ref": "#/components/schemas/_types.mapping:ObjectProperty" }, + { + "$ref": "#/components/schemas/_types.mapping:PassthroughObjectProperty" + }, { "$ref": "#/components/schemas/_types.mapping:SemanticTextProperty" }, @@ -61532,6 +61535,33 @@ } ] }, + "_types.mapping:PassthroughObjectProperty": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.mapping:CorePropertyBase" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "passthrough" + ] + }, + "enabled": { + "type": "boolean" + }, + "priority": { + "type": "number" + }, + "time_series_dimension": { + "type": "boolean" + } + } + } + ] + }, "_types.mapping:SemanticTextProperty": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 0ac9673a67..7b2689b6ff 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -40636,6 +40636,9 @@ { "$ref": "#/components/schemas/_types.mapping:ObjectProperty" }, + { + "$ref": "#/components/schemas/_types.mapping:PassthroughObjectProperty" + }, { "$ref": "#/components/schemas/_types.mapping:SemanticTextProperty" }, @@ -41727,6 +41730,33 @@ } ] }, + "_types.mapping:PassthroughObjectProperty": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.mapping:CorePropertyBase" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "passthrough" + ] + }, + "enabled": { + "type": "boolean" + }, + "priority": { + "type": "number" + }, + "time_series_dimension": { + "type": "boolean" + } + } + } + ] + }, "_types.mapping:SemanticTextProperty": { "type": "object", "properties": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 4803777e61..b63fd04cac 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -52800,6 +52800,9 @@ { "name": "object" }, + { + "name": "passthrough" + }, { "name": "version" }, @@ -52901,7 +52904,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L166-L213" + "specLocation": "_types/mapping/Property.ts#L168-L216" }, { "kind": "enum", @@ -86553,7 +86556,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L96-L164", + "specLocation": "_types/mapping/Property.ts#L97-L166", "type": { "items": [ { @@ -86696,6 +86699,13 @@ "namespace": "_types.mapping" } }, + { + "kind": "instance_of", + "type": { + "name": "PassthroughObjectProperty", + "namespace": "_types.mapping" + } + }, { "kind": "instance_of", "type": { @@ -87097,7 +87107,7 @@ } } ], - "specLocation": "_types/mapping/Property.ts#L84-L94" + "specLocation": "_types/mapping/Property.ts#L85-L95" }, { "inherits": { @@ -88710,7 +88720,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L51-L56" + "specLocation": "_types/mapping/complex.ts#L59-L64" }, { "inherits": { @@ -88979,7 +88989,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L25-L36" + "specLocation": "_types/mapping/complex.ts#L26-L37" }, { "inherits": { @@ -89036,7 +89046,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L38-L43" + "specLocation": "_types/mapping/complex.ts#L39-L44" }, { "inherits": { @@ -89082,7 +89092,64 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L45-L49" + "specLocation": "_types/mapping/complex.ts#L46-L50" + }, + { + "inherits": { + "type": { + "name": "CorePropertyBase", + "namespace": "_types.mapping" + } + }, + "kind": "interface", + "name": { + "name": "PassthroughObjectProperty", + "namespace": "_types.mapping" + }, + "properties": [ + { + "name": "type", + "required": false, + "type": { + "kind": "literal_value", + "value": "passthrough" + } + }, + { + "name": "enabled", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "time_series_dimension", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "_types/mapping/complex.ts#L52-L57" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index ccd54f6e08..997424e97a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -73346,7 +73346,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L51-L56" + "specLocation": "_types/mapping/complex.ts#L59-L64" }, { "kind": "interface", @@ -75004,6 +75004,9 @@ { "name": "object" }, + { + "name": "passthrough" + }, { "name": "version" }, @@ -75105,7 +75108,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L166-L213" + "specLocation": "_types/mapping/Property.ts#L168-L216" }, { "kind": "interface", @@ -75228,7 +75231,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L25-L36" + "specLocation": "_types/mapping/complex.ts#L26-L37" }, { "kind": "interface", @@ -76495,7 +76498,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L38-L43" + "specLocation": "_types/mapping/complex.ts#L39-L44" }, { "kind": "interface", @@ -76664,7 +76667,7 @@ } } ], - "specLocation": "_types/mapping/complex.ts#L45-L49" + "specLocation": "_types/mapping/complex.ts#L46-L50" }, { "kind": "enum", @@ -76682,6 +76685,63 @@ }, "specLocation": "_types/mapping/core.ts#L137-L140" }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "CorePropertyBase", + "namespace": "_types.mapping" + } + }, + "name": { + "name": "PassthroughObjectProperty", + "namespace": "_types.mapping" + }, + "properties": [ + { + "name": "type", + "required": false, + "type": { + "kind": "literal_value", + "value": "passthrough" + } + }, + { + "name": "enabled", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "priority", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "time_series_dimension", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "_types/mapping/complex.ts#L52-L57" + }, { "kind": "interface", "inherits": { @@ -76769,7 +76829,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L96-L164", + "specLocation": "_types/mapping/Property.ts#L97-L166", "type": { "kind": "union_of", "items": [ @@ -76913,6 +76973,13 @@ "namespace": "_types.mapping" } }, + { + "kind": "instance_of", + "type": { + "name": "PassthroughObjectProperty", + "namespace": "_types.mapping" + } + }, { "kind": "instance_of", "type": { @@ -77224,7 +77291,7 @@ } } ], - "specLocation": "_types/mapping/Property.ts#L84-L94" + "specLocation": "_types/mapping/Property.ts#L85-L95" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f9d4f74893..f58bf00118 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5525,7 +5525,7 @@ export interface MappingFieldNamesField { enabled: boolean } -export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'version' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'semantic_text' | 'sparse_vector' | 'match_only_text' | 'icu_collation_keyword' +export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'passthrough' | 'version' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'semantic_text' | 'sparse_vector' | 'match_only_text' | 'icu_collation_keyword' export interface MappingFlattenedProperty extends MappingPropertyBase { boost?: double @@ -5702,6 +5702,13 @@ export interface MappingObjectProperty extends MappingCorePropertyBase { export type MappingOnScriptError = 'fail' | 'continue' +export interface MappingPassthroughObjectProperty extends MappingCorePropertyBase { + type?: 'passthrough' + enabled?: boolean + priority?: integer + time_series_dimension?: boolean +} + export interface MappingPercolatorProperty extends MappingPropertyBase { type: 'percolator' } @@ -5713,7 +5720,7 @@ export interface MappingPointProperty extends MappingDocValuesPropertyBase { type: 'point' } -export type MappingProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDynamicProperty | MappingJoinProperty | MappingKeywordProperty | MappingMatchOnlyTextProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingSearchAsYouTypeProperty | MappingTextProperty | MappingVersionProperty | MappingWildcardProperty | MappingDateNanosProperty | MappingDateProperty | MappingAggregateMetricDoubleProperty | MappingDenseVectorProperty | MappingFlattenedProperty | MappingNestedProperty | MappingObjectProperty | MappingSemanticTextProperty | MappingSparseVectorProperty | MappingCompletionProperty | MappingConstantKeywordProperty | MappingFieldAliasProperty | MappingHistogramProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingTokenCountProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingPointProperty | MappingShapeProperty | MappingByteNumberProperty | MappingDoubleNumberProperty | MappingFloatNumberProperty | MappingHalfFloatNumberProperty | MappingIntegerNumberProperty | MappingLongNumberProperty | MappingScaledFloatNumberProperty | MappingShortNumberProperty | MappingUnsignedLongNumberProperty | MappingDateRangeProperty | MappingDoubleRangeProperty | MappingFloatRangeProperty | MappingIntegerRangeProperty | MappingIpRangeProperty | MappingLongRangeProperty | MappingIcuCollationProperty +export type MappingProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDynamicProperty | MappingJoinProperty | MappingKeywordProperty | MappingMatchOnlyTextProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingSearchAsYouTypeProperty | MappingTextProperty | MappingVersionProperty | MappingWildcardProperty | MappingDateNanosProperty | MappingDateProperty | MappingAggregateMetricDoubleProperty | MappingDenseVectorProperty | MappingFlattenedProperty | MappingNestedProperty | MappingObjectProperty | MappingPassthroughObjectProperty | MappingSemanticTextProperty | MappingSparseVectorProperty | MappingCompletionProperty | MappingConstantKeywordProperty | MappingFieldAliasProperty | MappingHistogramProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingTokenCountProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingPointProperty | MappingShapeProperty | MappingByteNumberProperty | MappingDoubleNumberProperty | MappingFloatNumberProperty | MappingHalfFloatNumberProperty | MappingIntegerNumberProperty | MappingLongNumberProperty | MappingScaledFloatNumberProperty | MappingShortNumberProperty | MappingUnsignedLongNumberProperty | MappingDateRangeProperty | MappingDoubleRangeProperty | MappingFloatRangeProperty | MappingIntegerRangeProperty | MappingIpRangeProperty | MappingLongRangeProperty | MappingIcuCollationProperty export interface MappingPropertyBase { meta?: Record diff --git a/specification/_types/mapping/Property.ts b/specification/_types/mapping/Property.ts index 456d835ea4..80da7a7caa 100644 --- a/specification/_types/mapping/Property.ts +++ b/specification/_types/mapping/Property.ts @@ -38,7 +38,8 @@ import { AggregateMetricDoubleProperty, FlattenedProperty, NestedProperty, - ObjectProperty + ObjectProperty, + PassthroughObjectProperty } from './complex' import { BinaryProperty, @@ -123,6 +124,7 @@ export type Property = | FlattenedProperty | NestedProperty | ObjectProperty + | PassthroughObjectProperty | SemanticTextProperty | SparseVectorProperty @@ -178,6 +180,7 @@ export enum FieldType { completion, nested, object, + passthrough, version, murmur3, token_count, diff --git a/specification/_types/mapping/complex.ts b/specification/_types/mapping/complex.ts index 5fa37f12ee..4cbb2a4f64 100644 --- a/specification/_types/mapping/complex.ts +++ b/specification/_types/mapping/complex.ts @@ -48,6 +48,13 @@ export class ObjectProperty extends CorePropertyBase { type?: 'object' } +export class PassthroughObjectProperty extends CorePropertyBase { + type?: 'passthrough' + enabled?: boolean + priority?: integer + time_series_dimension?: boolean +} + export class AggregateMetricDoubleProperty extends PropertyBase { type: 'aggregate_metric_double' default_metric: string