From 264b130179189ff5ae4eee49560d014007171e4d Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Thu, 6 Mar 2025 16:20:47 +0100 Subject: [PATCH 1/5] feat: add search_inference_id property --- specification/_types/mapping/core.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index c1233a18d9..593e1e5315 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -211,6 +211,7 @@ export class SemanticTextProperty { type: 'semantic_text' meta?: Dictionary inference_id: Id + search_inference_id?: Id } export class SearchAsYouTypeProperty extends CorePropertyBase { From d18be95cdad2bdd5c7dd0c9296b33d0cb300acf4 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Thu, 6 Mar 2025 16:34:46 +0100 Subject: [PATCH 2/5] fix: run make --- output/openapi/elasticsearch-openapi.json | 3 ++ .../elasticsearch-serverless-openapi.json | 3 ++ output/schema/schema-serverless.json | 29 +++++++++++++------ output/schema/schema.json | 29 +++++++++++++------ output/typescript/types.ts | 1 + 5 files changed, 47 insertions(+), 18 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 9b8cea87ce..5bbe68ea22 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -64684,6 +64684,9 @@ }, "inference_id": { "$ref": "#/components/schemas/_types:Id" + }, + "search_inference_id": { + "$ref": "#/components/schemas/_types:Id" } }, "required": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index da08b3dfb0..f5adca1708 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -42397,6 +42397,9 @@ }, "inference_id": { "$ref": "#/components/schemas/_types:Id" + }, + "search_inference_id": { + "$ref": "#/components/schemas/_types:Id" } }, "required": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 5621257ce9..6307850daa 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -88228,7 +88228,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L262-L267" + "specLocation": "_types/mapping/core.ts#L263-L268" }, { "kind": "enum", @@ -89242,7 +89242,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L306-L337" + "specLocation": "_types/mapping/core.ts#L307-L338" }, { "kind": "enum", @@ -89299,7 +89299,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L269-L272" + "specLocation": "_types/mapping/core.ts#L270-L273" }, { "kind": "enum", @@ -89660,7 +89660,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L235-L260" + "specLocation": "_types/mapping/core.ts#L236-L261" }, { "inherits": { @@ -89889,7 +89889,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L216-L227" + "specLocation": "_types/mapping/core.ts#L217-L228" }, { "inherits": { @@ -90102,7 +90102,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L274-L291" + "specLocation": "_types/mapping/core.ts#L275-L292" }, { "kind": "interface", @@ -90169,7 +90169,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L293-L295" + "specLocation": "_types/mapping/core.ts#L294-L296" }, { "inherits": { @@ -90210,7 +90210,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L297-L304" + "specLocation": "_types/mapping/core.ts#L298-L305" }, { "inherits": { @@ -91011,9 +91011,20 @@ "namespace": "_types" } } + }, + { + "name": "search_inference_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } } ], - "specLocation": "_types/mapping/core.ts#L210-L214" + "specLocation": "_types/mapping/core.ts#L210-L215" }, { "inherits": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 9503018aae..a236726ab6 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -76606,7 +76606,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L306-L337" + "specLocation": "_types/mapping/core.ts#L307-L338" }, { "kind": "interface", @@ -77779,7 +77779,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L262-L267" + "specLocation": "_types/mapping/core.ts#L263-L268" }, { "kind": "interface", @@ -78361,7 +78361,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L235-L260" + "specLocation": "_types/mapping/core.ts#L236-L261" }, { "kind": "enum", @@ -79808,7 +79808,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L216-L227" + "specLocation": "_types/mapping/core.ts#L217-L228" }, { "kind": "interface", @@ -79857,9 +79857,20 @@ "namespace": "_types" } } + }, + { + "name": "search_inference_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } } ], - "specLocation": "_types/mapping/core.ts#L210-L214" + "specLocation": "_types/mapping/core.ts#L210-L215" }, { "kind": "interface", @@ -80290,7 +80301,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L269-L272" + "specLocation": "_types/mapping/core.ts#L270-L273" }, { "kind": "interface", @@ -80503,7 +80514,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L274-L291" + "specLocation": "_types/mapping/core.ts#L275-L292" }, { "kind": "enum", @@ -80910,7 +80921,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L293-L295" + "specLocation": "_types/mapping/core.ts#L294-L296" }, { "kind": "interface", @@ -80951,7 +80962,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L297-L304" + "specLocation": "_types/mapping/core.ts#L298-L305" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 0b14cf8242..79d5689047 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5812,6 +5812,7 @@ export interface MappingSemanticTextProperty { type: 'semantic_text' meta?: Record inference_id: Id + search_inference_id?: Id } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { From 4fcb9da668dc35fa483f9c34123d34663903bf02 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 10 Mar 2025 10:56:33 +0400 Subject: [PATCH 3/5] Add descriptions for parameters --- output/schema/schema-serverless.json | 20 +++++++++++--------- output/schema/schema.json | 20 +++++++++++--------- specification/_types/mapping/core.ts | 10 ++++++++++ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 6307850daa..691f834c23 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -88228,7 +88228,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L263-L268" + "specLocation": "_types/mapping/core.ts#L273-L278" }, { "kind": "enum", @@ -89242,7 +89242,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L307-L338" + "specLocation": "_types/mapping/core.ts#L317-L348" }, { "kind": "enum", @@ -89299,7 +89299,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L270-L273" + "specLocation": "_types/mapping/core.ts#L280-L283" }, { "kind": "enum", @@ -89660,7 +89660,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L236-L261" + "specLocation": "_types/mapping/core.ts#L246-L271" }, { "inherits": { @@ -89889,7 +89889,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L217-L228" + "specLocation": "_types/mapping/core.ts#L227-L238" }, { "inherits": { @@ -90102,7 +90102,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L275-L292" + "specLocation": "_types/mapping/core.ts#L285-L302" }, { "kind": "interface", @@ -90169,7 +90169,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L294-L296" + "specLocation": "_types/mapping/core.ts#L304-L306" }, { "inherits": { @@ -90210,7 +90210,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L298-L305" + "specLocation": "_types/mapping/core.ts#L308-L315" }, { "inherits": { @@ -91002,6 +91002,7 @@ } }, { + "description": "Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", "name": "inference_id", "required": true, "type": { @@ -91013,6 +91014,7 @@ } }, { + "description": "Inference endpoint that will be used to generate embeddings at query time.\nYou can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint.\nIf not specified, the inference endpoint defined by inference_id will be used at both index and query time.", "name": "search_inference_id", "required": false, "type": { @@ -91024,7 +91026,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L215" + "specLocation": "_types/mapping/core.ts#L210-L225" }, { "inherits": { diff --git a/output/schema/schema.json b/output/schema/schema.json index a236726ab6..f0fecfac77 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -76606,7 +76606,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L307-L338" + "specLocation": "_types/mapping/core.ts#L317-L348" }, { "kind": "interface", @@ -77779,7 +77779,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L263-L268" + "specLocation": "_types/mapping/core.ts#L273-L278" }, { "kind": "interface", @@ -78361,7 +78361,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L236-L261" + "specLocation": "_types/mapping/core.ts#L246-L271" }, { "kind": "enum", @@ -79808,7 +79808,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L217-L228" + "specLocation": "_types/mapping/core.ts#L227-L238" }, { "kind": "interface", @@ -79848,6 +79848,7 @@ } }, { + "description": "Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", "name": "inference_id", "required": true, "type": { @@ -79859,6 +79860,7 @@ } }, { + "description": "Inference endpoint that will be used to generate embeddings at query time.\nYou can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint.\nIf not specified, the inference endpoint defined by inference_id will be used at both index and query time.", "name": "search_inference_id", "required": false, "type": { @@ -79870,7 +79872,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L215" + "specLocation": "_types/mapping/core.ts#L210-L225" }, { "kind": "interface", @@ -80301,7 +80303,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L270-L273" + "specLocation": "_types/mapping/core.ts#L280-L283" }, { "kind": "interface", @@ -80514,7 +80516,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L275-L292" + "specLocation": "_types/mapping/core.ts#L285-L302" }, { "kind": "enum", @@ -80921,7 +80923,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L294-L296" + "specLocation": "_types/mapping/core.ts#L304-L306" }, { "kind": "interface", @@ -80962,7 +80964,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L298-L305" + "specLocation": "_types/mapping/core.ts#L308-L315" }, { "kind": "interface", diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 593e1e5315..638cd8f5b2 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -210,7 +210,17 @@ export class SparseVectorProperty extends PropertyBase { export class SemanticTextProperty { type: 'semantic_text' meta?: Dictionary + /** + * Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used. + * This parameter cannot be updated. Use the Create inference API to create the endpoint. + * If `search_inference_id` is specified, the inference endpoint will only be used at index time. + */ inference_id: Id + /** + * Inference endpoint that will be used to generate embeddings at query time. + * You can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint. + * If not specified, the inference endpoint defined by inference_id will be used at both index and query time. + */ search_inference_id?: Id } From 7d9f18140017145392836fca54a2277529eb1531 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 10 Mar 2025 11:48:40 +0400 Subject: [PATCH 4/5] Mark inference_id as optional --- specification/_types/mapping/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 638cd8f5b2..8336f20cc7 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -215,7 +215,7 @@ export class SemanticTextProperty { * This parameter cannot be updated. Use the Create inference API to create the endpoint. * If `search_inference_id` is specified, the inference endpoint will only be used at index time. */ - inference_id: Id + inference_id?: Id /** * Inference endpoint that will be used to generate embeddings at query time. * You can update this parameter by using the Update mapping API. Use the Create inference API to create the endpoint. From 03a2a05934f00440c4c17f6645d6d3defa96c60c Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 10 Mar 2025 12:01:25 +0400 Subject: [PATCH 5/5] Add inference_id server default --- output/openapi/elasticsearch-openapi.json | 3 +-- .../elasticsearch-serverless-openapi.json | 3 +-- output/schema/schema-serverless.json | 23 ++++++++++--------- output/schema/schema.json | 23 ++++++++++--------- output/typescript/types.ts | 2 +- specification/_types/mapping/core.ts | 3 ++- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 5bbe68ea22..6f33c1b207 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -64690,8 +64690,7 @@ } }, "required": [ - "type", - "inference_id" + "type" ] }, "_types.mapping:SparseVectorProperty": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f5adca1708..fb1d1a9b25 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -42403,8 +42403,7 @@ } }, "required": [ - "type", - "inference_id" + "type" ] }, "_types.mapping:SparseVectorProperty": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 691f834c23..e4a03b2293 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -88228,7 +88228,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L273-L278" + "specLocation": "_types/mapping/core.ts#L274-L279" }, { "kind": "enum", @@ -89242,7 +89242,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L317-L348" + "specLocation": "_types/mapping/core.ts#L318-L349" }, { "kind": "enum", @@ -89299,7 +89299,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L280-L283" + "specLocation": "_types/mapping/core.ts#L281-L284" }, { "kind": "enum", @@ -89660,7 +89660,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L246-L271" + "specLocation": "_types/mapping/core.ts#L247-L272" }, { "inherits": { @@ -89889,7 +89889,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L227-L238" + "specLocation": "_types/mapping/core.ts#L228-L239" }, { "inherits": { @@ -90102,7 +90102,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L285-L302" + "specLocation": "_types/mapping/core.ts#L286-L303" }, { "kind": "interface", @@ -90169,7 +90169,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L304-L306" + "specLocation": "_types/mapping/core.ts#L305-L307" }, { "inherits": { @@ -90210,7 +90210,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L308-L315" + "specLocation": "_types/mapping/core.ts#L309-L316" }, { "inherits": { @@ -91002,9 +91002,10 @@ } }, { - "description": "Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", + "description": "Inference endpoint that will be used to generate embeddings for the field.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", "name": "inference_id", - "required": true, + "required": false, + "serverDefault": ".elser-2-elasticsearch", "type": { "kind": "instance_of", "type": { @@ -91026,7 +91027,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L225" + "specLocation": "_types/mapping/core.ts#L210-L226" }, { "inherits": { diff --git a/output/schema/schema.json b/output/schema/schema.json index f0fecfac77..28a6b4cf38 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -76606,7 +76606,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L317-L348" + "specLocation": "_types/mapping/core.ts#L318-L349" }, { "kind": "interface", @@ -77779,7 +77779,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L273-L278" + "specLocation": "_types/mapping/core.ts#L274-L279" }, { "kind": "interface", @@ -78361,7 +78361,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L246-L271" + "specLocation": "_types/mapping/core.ts#L247-L272" }, { "kind": "enum", @@ -79808,7 +79808,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L227-L238" + "specLocation": "_types/mapping/core.ts#L228-L239" }, { "kind": "interface", @@ -79848,9 +79848,10 @@ } }, { - "description": "Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", + "description": "Inference endpoint that will be used to generate embeddings for the field.\nThis parameter cannot be updated. Use the Create inference API to create the endpoint.\nIf `search_inference_id` is specified, the inference endpoint will only be used at index time.", "name": "inference_id", - "required": true, + "required": false, + "serverDefault": ".elser-2-elasticsearch", "type": { "kind": "instance_of", "type": { @@ -79872,7 +79873,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L225" + "specLocation": "_types/mapping/core.ts#L210-L226" }, { "kind": "interface", @@ -80303,7 +80304,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L280-L283" + "specLocation": "_types/mapping/core.ts#L281-L284" }, { "kind": "interface", @@ -80516,7 +80517,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L285-L302" + "specLocation": "_types/mapping/core.ts#L286-L303" }, { "kind": "enum", @@ -80923,7 +80924,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L304-L306" + "specLocation": "_types/mapping/core.ts#L305-L307" }, { "kind": "interface", @@ -80964,7 +80965,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L308-L315" + "specLocation": "_types/mapping/core.ts#L309-L316" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 79d5689047..ca5f0d85d6 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5811,7 +5811,7 @@ export interface MappingSearchAsYouTypeProperty extends MappingCorePropertyBase export interface MappingSemanticTextProperty { type: 'semantic_text' meta?: Record - inference_id: Id + inference_id?: Id search_inference_id?: Id } diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 8336f20cc7..52db74be88 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -211,9 +211,10 @@ export class SemanticTextProperty { type: 'semantic_text' meta?: Dictionary /** - * Inference endpoint that will be used to generate embeddings for the field. By default, `.elser-2-elasticsearch` is used. + * Inference endpoint that will be used to generate embeddings for the field. * This parameter cannot be updated. Use the Create inference API to create the endpoint. * If `search_inference_id` is specified, the inference endpoint will only be used at index time. + * @server_default .elser-2-elasticsearch */ inference_id?: Id /**