From 0aa4609066da81de22e7c88fa66524af0445b14e Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Tue, 11 Mar 2025 06:04:11 +0100 Subject: [PATCH] Add search_inference_id property (#3901) --------- Co-authored-by: Quentin Pradet (cherry picked from commit e4cedeed985b83c9bea600012d0201ae2ab38b2d) --- output/openapi/elasticsearch-openapi.json | 6 ++-- .../elasticsearch-serverless-openapi.json | 6 ++-- output/schema/schema-serverless.json | 34 +++++++++++++------ output/schema/schema.json | 34 +++++++++++++------ output/typescript/types.ts | 3 +- specification/_types/mapping/core.ts | 14 +++++++- 6 files changed, 71 insertions(+), 26 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 75cd5b1485..41f5d8a93e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -63681,11 +63681,13 @@ }, "inference_id": { "$ref": "#/components/schemas/_types:Id" + }, + "search_inference_id": { + "$ref": "#/components/schemas/_types:Id" } }, "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 4375856d74..ab6fe8e6fa 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -42036,11 +42036,13 @@ }, "inference_id": { "$ref": "#/components/schemas/_types:Id" + }, + "search_inference_id": { + "$ref": "#/components/schemas/_types:Id" } }, "required": [ - "type", - "inference_id" + "type" ] }, "_types.mapping:SparseVectorProperty": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index ce6e7a3842..f3f088e9b3 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -87273,7 +87273,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L258-L263" + "specLocation": "_types/mapping/core.ts#L270-L275" }, { "kind": "enum", @@ -88273,7 +88273,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L302-L333" + "specLocation": "_types/mapping/core.ts#L314-L345" }, { "kind": "enum", @@ -88330,7 +88330,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L265-L268" + "specLocation": "_types/mapping/core.ts#L277-L280" }, { "kind": "enum", @@ -88691,7 +88691,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L231-L256" + "specLocation": "_types/mapping/core.ts#L243-L268" }, { "inherits": { @@ -88920,7 +88920,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L212-L223" + "specLocation": "_types/mapping/core.ts#L224-L235" }, { "inherits": { @@ -89133,7 +89133,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L270-L287" + "specLocation": "_types/mapping/core.ts#L282-L299" }, { "kind": "interface", @@ -89200,7 +89200,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L289-L291" + "specLocation": "_types/mapping/core.ts#L301-L303" }, { "inherits": { @@ -89241,7 +89241,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L293-L300" + "specLocation": "_types/mapping/core.ts#L305-L312" }, { "inherits": { @@ -89902,8 +89902,22 @@ } }, { + "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": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "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": { "kind": "instance_of", "type": { @@ -89913,7 +89927,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L206-L210" + "specLocation": "_types/mapping/core.ts#L206-L222" }, { "inherits": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 9fd8f0ae21..d9e87592cf 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -75830,7 +75830,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L302-L333" + "specLocation": "_types/mapping/core.ts#L314-L345" }, { "kind": "interface", @@ -76997,7 +76997,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L258-L263" + "specLocation": "_types/mapping/core.ts#L270-L275" }, { "kind": "interface", @@ -77579,7 +77579,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L231-L256" + "specLocation": "_types/mapping/core.ts#L243-L268" }, { "kind": "enum", @@ -78955,7 +78955,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L212-L223" + "specLocation": "_types/mapping/core.ts#L224-L235" }, { "kind": "interface", @@ -78995,8 +78995,22 @@ } }, { + "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": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "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": { "kind": "instance_of", "type": { @@ -79006,7 +79020,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L206-L210" + "specLocation": "_types/mapping/core.ts#L206-L222" }, { "kind": "interface", @@ -79410,7 +79424,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L265-L268" + "specLocation": "_types/mapping/core.ts#L277-L280" }, { "kind": "interface", @@ -79623,7 +79637,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L270-L287" + "specLocation": "_types/mapping/core.ts#L282-L299" }, { "kind": "enum", @@ -80030,7 +80044,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L289-L291" + "specLocation": "_types/mapping/core.ts#L301-L303" }, { "kind": "interface", @@ -80071,7 +80085,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L293-L300" + "specLocation": "_types/mapping/core.ts#L305-L312" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index acdff691c9..bd9108fb36 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5776,7 +5776,8 @@ export interface MappingSearchAsYouTypeProperty extends MappingCorePropertyBase export interface MappingSemanticTextProperty { type: 'semantic_text' meta?: Record - inference_id: Id + inference_id?: Id + search_inference_id?: Id } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index aa25c6d091..2c105abec4 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -206,7 +206,19 @@ export class SparseVectorProperty extends PropertyBase { export class SemanticTextProperty { type: 'semantic_text' meta?: Dictionary - inference_id: Id + /** + * 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 + /** + * 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 } export class SearchAsYouTypeProperty extends CorePropertyBase {