From 238822b95bf65c6a6f72ff906f6fae7ee70be8b7 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 30 Sep 2025 16:08:04 +0400 Subject: [PATCH] Allow multi-fields in semantic_text property --- output/openapi/elasticsearch-openapi.json | 7 +++ .../elasticsearch-serverless-openapi.json | 7 +++ output/schema/schema.json | 45 ++++++++++++++----- output/typescript/types.ts | 1 + specification/_types/mapping/core.ts | 6 +++ 5 files changed, 56 insertions(+), 10 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8b3580db79..e5224d2ab6 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -86379,6 +86379,13 @@ "$ref": "#/components/schemas/_types.mapping.ChunkingSettings" } ] + }, + "fields": { + "description": "Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.mapping.Property" + } } }, "required": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2431ed80ef..51a2a47ca4 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -58648,6 +58648,13 @@ "$ref": "#/components/schemas/_types.mapping.ChunkingSettings" } ] + }, + "fields": { + "description": "Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.mapping.Property" + } } }, "required": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 0c1103f390..fa3eaf84a5 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -84002,7 +84002,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L360-L391" + "specLocation": "_types/mapping/core.ts#L367-L398" }, { "kind": "interface", @@ -85230,7 +85230,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L316-L321" + "specLocation": "_types/mapping/core.ts#L323-L328" }, { "kind": "interface", @@ -85812,7 +85812,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L289-L314" + "specLocation": "_types/mapping/core.ts#L296-L321" }, { "kind": "enum", @@ -86865,7 +86865,7 @@ "name": "RankVectorElementType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L393-L397" + "specLocation": "_types/mapping/core.ts#L400-L404" }, { "kind": "interface", @@ -87335,7 +87335,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L270-L281" + "specLocation": "_types/mapping/core.ts#L277-L288" }, { "kind": "interface", @@ -87443,9 +87443,34 @@ "namespace": "_types.mapping" } } + }, + { + "description": "Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one\nfield for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.", + "docId": "multi-fields", + "docUrl": "https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/multi-fields", + "name": "fields", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "PropertyName", + "namespace": "_types" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "Property", + "namespace": "_types.mapping" + } + } + } } ], - "specLocation": "_types/mapping/core.ts#L239-L268" + "specLocation": "_types/mapping/core.ts#L239-L275" }, { "kind": "interface", @@ -87953,7 +87978,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L323-L326" + "specLocation": "_types/mapping/core.ts#L330-L333" }, { "kind": "interface", @@ -88166,7 +88191,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L328-L345" + "specLocation": "_types/mapping/core.ts#L335-L352" }, { "kind": "enum", @@ -88573,7 +88598,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L347-L349" + "specLocation": "_types/mapping/core.ts#L354-L356" }, { "kind": "interface", @@ -88614,7 +88639,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L351-L358" + "specLocation": "_types/mapping/core.ts#L358-L365" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 06a657694a..4c3b671f75 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6066,6 +6066,7 @@ export interface MappingSemanticTextProperty { search_inference_id?: Id index_options?: MappingSemanticTextIndexOptions chunking_settings?: MappingChunkingSettings + fields?: Record } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 6a178c2ba5..eb5cb3c8f7 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -265,6 +265,12 @@ export class SemanticTextProperty { * they will not be applied to existing documents until they are reindexed. */ chunking_settings?: ChunkingSettings + /** + * Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + * field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + * @doc_id multi-fields + */ + fields?: Dictionary } export class SearchAsYouTypeProperty extends CorePropertyBase {