From 45873c6fd4d1695892b81aba61f42418703905c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Saint-F=C3=A9lix?= Date: Tue, 14 Nov 2023 15:52:08 +0100 Subject: [PATCH 1/4] Add sparse vector property (#2345) * Add SparseVectorProperty to Property union * make contrib * Add output/openapi/elasticsearch-serverless-openapi.json to .gitattributes --- .gitattributes | 1 + .../elasticsearch-serverless-openapi.json | 24 +++++++++++++ output/schema/schema.json | 35 +++++++++++++++++-- output/typescript/types.ts | 6 +++- specification/_types/mapping/Property.ts | 2 ++ 5 files changed, 65 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index c1603df728..10b2ef08b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ output/dangling-types/dangling.csv linguist-generated=true output/schema/schema.json linguist-generated=true +output/openapi/elasticsearch-serverless-openapi.json linguist-generated=true output/schema/import-type-graph.json linguist-generated=true output/schema/import-namespace-graph-compact.json linguist-generated=true output/schema/import-namespace-graph-expanded.json linguist-generated=true diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index de48bf624a..730da90382 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -45049,6 +45049,9 @@ { "$ref": "#/components/schemas/_types.mapping:DenseVectorProperty" }, + { + "$ref": "#/components/schemas/_types.mapping:SparseVectorProperty" + }, { "$ref": "#/components/schemas/_types.mapping:FlattenedProperty" }, @@ -45955,6 +45958,27 @@ "ef_construction" ] }, + "_types.mapping:SparseVectorProperty": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.mapping:PropertyBase" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "sparse_vector" + ] + } + }, + "required": [ + "type" + ] + } + ] + }, "_types.mapping:FlattenedProperty": { "allOf": [ { diff --git a/output/schema/schema.json b/output/schema/schema.json index 1c6bf48dd1..fda5ce0ac4 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -68417,7 +68417,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L158-L202" + "specLocation": "_types/mapping/Property.ts#L159-L203" }, { "inherits": { @@ -69794,7 +69794,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L93-L156", + "specLocation": "_types/mapping/Property.ts#L93-L157", "type": { "items": [ { @@ -69916,6 +69916,13 @@ "namespace": "_types.mapping" } }, + { + "kind": "instance_of", + "type": { + "name": "SparseVectorProperty", + "namespace": "_types.mapping" + } + }, { "kind": "instance_of", "type": { @@ -70938,6 +70945,30 @@ }, "specLocation": "_types/mapping/meta-fields.ts#L67-L75" }, + { + "inherits": { + "type": { + "name": "PropertyBase", + "namespace": "_types.mapping" + } + }, + "kind": "interface", + "name": { + "name": "SparseVectorProperty", + "namespace": "_types.mapping" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "sparse_vector" + } + } + ], + "specLocation": "_types/mapping/core.ts#L193-L195" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2efbfbc87b..eb7ea303ff 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5166,7 +5166,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 | 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 +export type MappingProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDynamicProperty | MappingJoinProperty | MappingKeywordProperty | MappingMatchOnlyTextProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingSearchAsYouTypeProperty | MappingTextProperty | MappingVersionProperty | MappingWildcardProperty | MappingDateNanosProperty | MappingDateProperty | MappingAggregateMetricDoubleProperty | MappingDenseVectorProperty | MappingSparseVectorProperty | MappingFlattenedProperty | MappingNestedProperty | MappingObjectProperty | 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 export interface MappingPropertyBase { meta?: Record @@ -5260,6 +5260,10 @@ export interface MappingSourceField { export type MappingSourceFieldMode = 'disabled' | 'stored' | 'synthetic' +export interface MappingSparseVectorProperty extends MappingPropertyBase { + type: 'sparse_vector' +} + export interface MappingSuggestContext { name: Name path?: Field diff --git a/specification/_types/mapping/Property.ts b/specification/_types/mapping/Property.ts index 52e8374372..26f04432f4 100644 --- a/specification/_types/mapping/Property.ts +++ b/specification/_types/mapping/Property.ts @@ -48,6 +48,7 @@ import { ScaledFloatNumberProperty, SearchAsYouTypeProperty, ShortNumberProperty, + SparseVectorProperty, TextProperty, UnsignedLongNumberProperty, VersionProperty, @@ -117,6 +118,7 @@ export type Property = // complex | AggregateMetricDoubleProperty | DenseVectorProperty + | SparseVectorProperty | FlattenedProperty | NestedProperty | ObjectProperty From ab87bca5715f183ec2d363ea4cc7c1a237032f9f Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 14 Nov 2023 14:52:51 +0000 Subject: [PATCH 2/4] Update specification output --- output/schema/schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index fda5ce0ac4..8655118af8 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -68417,7 +68417,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L159-L203" + "specLocation": "_types/mapping/Property.ts#L160-L204" }, { "inherits": { @@ -69794,7 +69794,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L93-L157", + "specLocation": "_types/mapping/Property.ts#L94-L158", "type": { "items": [ { @@ -70235,7 +70235,7 @@ } } ], - "specLocation": "_types/mapping/Property.ts#L81-L91" + "specLocation": "_types/mapping/Property.ts#L82-L92" }, { "inherits": { From 879994b48801535eeef3f219e8dbaa5eb907627d Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 14 Nov 2023 12:53:16 -0600 Subject: [PATCH 3/4] Add optional _meta object to ingest pipeline response (#2348) --- specification/ingest/_types/Pipeline.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/ingest/_types/Pipeline.ts b/specification/ingest/_types/Pipeline.ts index 70f9dc786f..178717b507 100644 --- a/specification/ingest/_types/Pipeline.ts +++ b/specification/ingest/_types/Pipeline.ts @@ -17,7 +17,7 @@ * under the License. */ -import { VersionNumber } from '@_types/common' +import { VersionNumber, Metadata } from '@_types/common' import { ProcessorContainer } from './Processors' export class Pipeline { @@ -38,6 +38,10 @@ export class Pipeline { * Version number used by external systems to track ingest pipelines. */ version?: VersionNumber + /** + * Arbitrary metadata about the ingest pipeline. This map is not automatically generated by Elasticsearch. + */ + _meta: Metadata } // Unused .. but let's keep it for now From 126f6d1e1cbf1742d3c319562025fc09ae7be1e2 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 14 Nov 2023 18:53:57 +0000 Subject: [PATCH 4/4] Update specification output --- output/schema/schema.json | 16 ++++++++++++++-- output/typescript/types.ts | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 8655118af8..c273770905 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -129261,9 +129261,21 @@ "namespace": "_types" } } + }, + { + "description": "Arbitrary metadata about the ingest pipeline. This map is not automatically generated by Elasticsearch.", + "name": "_meta", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Metadata", + "namespace": "_types" + } + } } ], - "specLocation": "ingest/_types/Pipeline.ts#L23-L41" + "specLocation": "ingest/_types/Pipeline.ts#L23-L45" }, { "kind": "interface", @@ -129312,7 +129324,7 @@ } } ], - "specLocation": "ingest/_types/Pipeline.ts#L57-L71" + "specLocation": "ingest/_types/Pipeline.ts#L61-L75" }, { "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index eb7ea303ff..c5c3f6be91 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11626,6 +11626,7 @@ export interface IngestPipeline { on_failure?: IngestProcessorContainer[] processors?: IngestProcessorContainer[] version?: VersionNumber + _meta: Metadata } export interface IngestPipelineConfig {