diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index b41eea25f9..17fe09f1b9 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -68856,12 +68856,59 @@ }, "search_inference_id": { "$ref": "#/components/schemas/_types.Id" + }, + "chunking_settings": { + "$ref": "#/components/schemas/_types.mapping.ChunkingSettings" } }, "required": [ "type" ] }, + "_types.mapping.ChunkingSettings": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/_types.mapping.ChunkingStrategy" + }, + "max_chunk_size": { + "description": "The maximum number of words in a chunk.", + "type": "number" + }, + "overlap": { + "description": "The number of overlapping words allowed in chunks. This cannot be \ndefined as more than half of the max_chunk_size. Required for `word`\ntype chunking settings.", + "type": "number" + }, + "sentence_overlap": { + "description": "The number of overlapping sentences allowed in chunks. Required for `sentence` type chunking settings.", + "oneOf": [ + { + "type": "string", + "enum": [ + "0" + ] + }, + { + "type": "string", + "enum": [ + "1" + ] + } + ] + } + }, + "required": [ + "type", + "max_chunk_size" + ] + }, + "_types.mapping.ChunkingStrategy": { + "type": "string", + "enum": [ + "word", + "sentence" + ] + }, "_types.mapping.SparseVectorProperty": { "allOf": [ { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index de81fb6334..e4fcdd662f 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -45479,12 +45479,59 @@ }, "search_inference_id": { "$ref": "#/components/schemas/_types.Id" + }, + "chunking_settings": { + "$ref": "#/components/schemas/_types.mapping.ChunkingSettings" } }, "required": [ "type" ] }, + "_types.mapping.ChunkingSettings": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/_types.mapping.ChunkingStrategy" + }, + "max_chunk_size": { + "description": "The maximum number of words in a chunk.", + "type": "number" + }, + "overlap": { + "description": "The number of overlapping words allowed in chunks. This cannot be \ndefined as more than half of the max_chunk_size. Required for `word`\ntype chunking settings.", + "type": "number" + }, + "sentence_overlap": { + "description": "The number of overlapping sentences allowed in chunks. Required for `sentence` type chunking settings.", + "oneOf": [ + { + "type": "string", + "enum": [ + "0" + ] + }, + { + "type": "string", + "enum": [ + "1" + ] + } + ] + } + }, + "required": [ + "type", + "max_chunk_size" + ] + }, + "_types.mapping.ChunkingStrategy": { + "type": "string", + "enum": [ + "word", + "sentence" + ] + }, "_types.mapping.SparseVectorProperty": { "allOf": [ { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index f2d98d7cc3..bc1398807a 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -93797,6 +93797,22 @@ ], "specLocation": "_types/analysis/nori-plugin.ts#L28-L34" }, + { + "kind": "enum", + "members": [ + { + "name": "word" + }, + { + "name": "sentence" + } + ], + "name": { + "name": "ChunkingStrategy", + "namespace": "_types.mapping" + }, + "specLocation": "_types/mapping/ChunkingSettings.ts#L47-L50" + }, { "kind": "enum", "members": [ @@ -93972,7 +93988,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L283-L288" + "specLocation": "_types/mapping/core.ts#L291-L296" }, { "kind": "enum", @@ -94004,7 +94020,7 @@ "name": "OnScriptError", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L150-L153" + "specLocation": "_types/mapping/core.ts#L151-L154" }, { "kind": "type_alias", @@ -94404,7 +94420,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L54-L56" + "specLocation": "_types/mapping/core.ts#L55-L57" }, { "inherits": { @@ -94431,7 +94447,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L50-L52" + "specLocation": "_types/mapping/core.ts#L51-L53" }, { "inherits": { @@ -94469,7 +94485,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L45-L48" + "specLocation": "_types/mapping/core.ts#L46-L49" }, { "kind": "interface", @@ -94724,7 +94740,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L58-L73" + "specLocation": "_types/mapping/core.ts#L59-L74" }, { "kind": "interface", @@ -95039,7 +95055,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L327-L358" + "specLocation": "_types/mapping/core.ts#L335-L366" }, { "kind": "enum", @@ -95096,7 +95112,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L290-L293" + "specLocation": "_types/mapping/core.ts#L298-L301" }, { "kind": "enum", @@ -95199,7 +95215,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L101-L105" + "specLocation": "_types/mapping/core.ts#L102-L106" }, { "inherits": { @@ -95376,7 +95392,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L107-L126" + "specLocation": "_types/mapping/core.ts#L108-L127" }, { "description": "A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field\neffectively stores data the same way as a text field that only indexes documents (index_options: docs) and\ndisables norms (norms: false). Term queries perform as fast if not faster as on text fields, however queries\nthat need positions such as the match_phrase query perform slower as they need to look at the _source document\nto verify whether a phrase matches. All queries return constant scores that are equal to 1.0.", @@ -95457,7 +95473,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L256-L281" + "specLocation": "_types/mapping/core.ts#L264-L289" }, { "inherits": { @@ -95481,7 +95497,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L201-L203" + "specLocation": "_types/mapping/core.ts#L202-L204" }, { "inherits": { @@ -95516,7 +95532,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L205-L208" + "specLocation": "_types/mapping/core.ts#L206-L209" }, { "inherits": { @@ -95551,7 +95567,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L213" + "specLocation": "_types/mapping/core.ts#L211-L214" }, { "inherits": { @@ -95686,7 +95702,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L237-L248" + "specLocation": "_types/mapping/core.ts#L245-L256" }, { "inherits": { @@ -95899,7 +95915,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L295-L312" + "specLocation": "_types/mapping/core.ts#L303-L320" }, { "kind": "interface", @@ -95966,7 +95982,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L314-L316" + "specLocation": "_types/mapping/core.ts#L322-L324" }, { "inherits": { @@ -96007,7 +96023,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L318-L325" + "specLocation": "_types/mapping/core.ts#L326-L333" }, { "inherits": { @@ -96119,7 +96135,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L89-L99" + "specLocation": "_types/mapping/core.ts#L90-L100" }, { "inherits": { @@ -96253,7 +96269,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L75-L87" + "specLocation": "_types/mapping/core.ts#L76-L88" }, { "inherits": { @@ -96856,9 +96872,85 @@ "namespace": "_types" } } + }, + { + "description": "Settings for chunking text into smaller passages. If specified, these will override the \nchunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated,\nthey will not be applied to existing documents until they are reindexed.", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ChunkingSettings", + "namespace": "_types.mapping" + } + } + } + ], + "specLocation": "_types/mapping/core.ts#L220-L243" + }, + { + "kind": "interface", + "name": { + "name": "ChunkingSettings", + "namespace": "_types.mapping" + }, + "properties": [ + { + "description": "Indicates the type of strategy to use.", + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ChunkingStrategy", + "namespace": "_types.mapping" + } + } + }, + { + "description": "The maximum number of words in a chunk.", + "name": "max_chunk_size", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The number of overlapping words allowed in chunks. This cannot be \ndefined as more than half of the max_chunk_size. Required for `word`\ntype chunking settings.", + "name": "overlap", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The number of overlapping sentences allowed in chunks. Required for `sentence` type chunking settings.", + "name": "sentence_overlap", + "required": false, + "type": { + "items": [ + { + "kind": "literal_value", + "value": 0 + }, + { + "kind": "literal_value", + "value": 1 + } + ], + "kind": "union_of" + } } ], - "specLocation": "_types/mapping/core.ts#L219-L235" + "specLocation": "_types/mapping/ChunkingSettings.ts#L22-L45" }, { "inherits": { @@ -96882,7 +96974,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L215-L217" + "specLocation": "_types/mapping/core.ts#L216-L218" }, { "inherits": { @@ -97736,7 +97828,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L185-L188" + "specLocation": "_types/mapping/core.ts#L186-L189" }, { "inherits": { @@ -97859,7 +97951,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L128-L148" + "specLocation": "_types/mapping/core.ts#L129-L149" }, { "inherits": { @@ -97894,7 +97986,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L165-L168" + "specLocation": "_types/mapping/core.ts#L166-L169" }, { "inherits": { @@ -97929,7 +98021,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L155-L158" + "specLocation": "_types/mapping/core.ts#L156-L159" }, { "inherits": { @@ -97964,7 +98056,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L160-L163" + "specLocation": "_types/mapping/core.ts#L161-L164" }, { "inherits": { @@ -97999,7 +98091,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L170-L173" + "specLocation": "_types/mapping/core.ts#L171-L174" }, { "inherits": { @@ -98034,7 +98126,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L175-L178" + "specLocation": "_types/mapping/core.ts#L176-L179" }, { "inherits": { @@ -98080,7 +98172,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L195-L199" + "specLocation": "_types/mapping/core.ts#L196-L200" }, { "inherits": { @@ -98115,7 +98207,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L180-L183" + "specLocation": "_types/mapping/core.ts#L181-L184" }, { "inherits": { @@ -98150,7 +98242,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L190-L193" + "specLocation": "_types/mapping/core.ts#L191-L194" }, { "inherits": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 4ca015748b..bba5478e44 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -77147,7 +77147,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L54-L56" + "specLocation": "_types/mapping/core.ts#L55-L57" }, { "kind": "interface", @@ -77268,7 +77268,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L58-L73" + "specLocation": "_types/mapping/core.ts#L59-L74" }, { "kind": "interface", @@ -77303,7 +77303,89 @@ } } ], - "specLocation": "_types/mapping/core.ts#L185-L188" + "specLocation": "_types/mapping/core.ts#L186-L189" + }, + { + "kind": "interface", + "attachedBehaviors": [ + "OverloadOf" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + } + } + ], + "type": { + "name": "OverloadOf", + "namespace": "_spec_utils" + } + } + ], + "name": { + "name": "ChunkingSettings", + "namespace": "_types.mapping" + }, + "properties": [ + { + "description": "The chunking strategy: `sentence` or `word`.", + "name": "strategy", + "required": true, + "serverDefault": "sentence", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The maximum size of a chunk in words.\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).", + "name": "max_chunk_size", + "required": true, + "serverDefault": 250, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.", + "name": "overlap", + "required": false, + "serverDefault": 100, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.", + "name": "sentence_overlap", + "required": false, + "serverDefault": 1, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ], + "specLocation": "_types/mapping/ChunkingSettings.ts#L24-L32" }, { "kind": "interface", @@ -77486,7 +77568,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L45-L48" + "specLocation": "_types/mapping/core.ts#L46-L49" }, { "kind": "interface", @@ -77654,7 +77736,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L89-L99" + "specLocation": "_types/mapping/core.ts#L90-L100" }, { "kind": "interface", @@ -77788,7 +77870,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L75-L87" + "specLocation": "_types/mapping/core.ts#L76-L88" }, { "kind": "interface", @@ -78120,7 +78202,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L50-L52" + "specLocation": "_types/mapping/core.ts#L51-L53" }, { "kind": "interface", @@ -78155,7 +78237,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L165-L168" + "specLocation": "_types/mapping/core.ts#L166-L169" }, { "kind": "interface", @@ -78480,7 +78562,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L327-L358" + "specLocation": "_types/mapping/core.ts#L335-L366" }, { "kind": "interface", @@ -79100,7 +79182,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L155-L158" + "specLocation": "_types/mapping/core.ts#L156-L159" }, { "kind": "interface", @@ -79384,7 +79466,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L160-L163" + "specLocation": "_types/mapping/core.ts#L161-L164" }, { "kind": "interface", @@ -79664,7 +79746,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L283-L288" + "specLocation": "_types/mapping/core.ts#L291-L296" }, { "kind": "interface", @@ -79699,7 +79781,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L170-L173" + "specLocation": "_types/mapping/core.ts#L171-L174" }, { "kind": "interface", @@ -79929,7 +80011,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L101-L105" + "specLocation": "_types/mapping/core.ts#L102-L106" }, { "kind": "interface", @@ -80106,7 +80188,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L107-L126" + "specLocation": "_types/mapping/core.ts#L108-L127" }, { "kind": "interface", @@ -80141,7 +80223,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L175-L178" + "specLocation": "_types/mapping/core.ts#L176-L179" }, { "kind": "interface", @@ -80246,7 +80328,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L256-L281" + "specLocation": "_types/mapping/core.ts#L264-L289" }, { "kind": "enum", @@ -80466,7 +80548,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L128-L148" + "specLocation": "_types/mapping/core.ts#L129-L149" }, { "kind": "interface", @@ -80528,7 +80610,7 @@ "name": "OnScriptError", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L150-L153" + "specLocation": "_types/mapping/core.ts#L151-L154" }, { "kind": "interface", @@ -80609,7 +80691,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L201-L203" + "specLocation": "_types/mapping/core.ts#L202-L204" }, { "kind": "interface", @@ -81238,7 +81320,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L205-L208" + "specLocation": "_types/mapping/core.ts#L206-L209" }, { "kind": "interface", @@ -81273,7 +81355,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L210-L213" + "specLocation": "_types/mapping/core.ts#L211-L214" }, { "kind": "interface", @@ -81561,7 +81643,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L195-L199" + "specLocation": "_types/mapping/core.ts#L196-L200" }, { "kind": "interface", @@ -81696,7 +81778,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L237-L248" + "specLocation": "_types/mapping/core.ts#L245-L256" }, { "kind": "interface", @@ -81759,9 +81841,21 @@ "namespace": "_types" } } + }, + { + "description": "Settings for chunking text into smaller passages. If specified, these will override the\nchunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated,\nthey will not be applied to existing documents until they are reindexed.", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ChunkingSettings", + "namespace": "_types.mapping" + } + } } ], - "specLocation": "_types/mapping/core.ts#L219-L235" + "specLocation": "_types/mapping/core.ts#L220-L243" }, { "kind": "interface", @@ -81867,7 +81961,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L180-L183" + "specLocation": "_types/mapping/core.ts#L181-L184" }, { "kind": "interface", @@ -82014,7 +82108,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L215-L217" + "specLocation": "_types/mapping/core.ts#L216-L218" }, { "kind": "enum", @@ -82192,7 +82286,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L290-L293" + "specLocation": "_types/mapping/core.ts#L298-L301" }, { "kind": "interface", @@ -82405,7 +82499,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L295-L312" + "specLocation": "_types/mapping/core.ts#L303-L320" }, { "kind": "enum", @@ -82788,7 +82882,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L190-L193" + "specLocation": "_types/mapping/core.ts#L191-L194" }, { "kind": "interface", @@ -82812,7 +82906,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L314-L316" + "specLocation": "_types/mapping/core.ts#L322-L324" }, { "kind": "interface", @@ -82853,7 +82947,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L318-L325" + "specLocation": "_types/mapping/core.ts#L326-L333" }, { "kind": "interface", @@ -244386,6 +244480,22 @@ ], "specLocation": "_spec_utils/behaviors.ts#L41-L75" }, + { + "kind": "interface", + "description": "A class that implements `OverloadOf` should have the exact same properties with the same types.\nIt can change if a property is required or not. There is no need to port the descriptions\nand js doc tags, the compiler will do that for you.", + "generics": [ + { + "name": "TDefinition", + "namespace": "_spec_utils.OverloadOf" + } + ], + "name": { + "name": "OverloadOf", + "namespace": "_spec_utils" + }, + "properties": [], + "specLocation": "_spec_utils/behaviors.ts#L102-L108" + }, { "kind": "interface", "description": "Implements a set of common query parameters all Cat API's support.\nSince these can break the request structure these are listed explicitly as a behavior.", @@ -244435,22 +244545,6 @@ } ], "specLocation": "_spec_utils/behaviors.ts#L77-L100" - }, - { - "kind": "interface", - "description": "A class that implements `OverloadOf` should have the exact same properties with the same types.\nIt can change if a property is required or not. There is no need to port the descriptions\nand js doc tags, the compiler will do that for you.", - "generics": [ - { - "name": "TDefinition", - "namespace": "_spec_utils.OverloadOf" - } - ], - "name": { - "name": "OverloadOf", - "namespace": "_spec_utils" - }, - "properties": [], - "specLocation": "_spec_utils/behaviors.ts#L102-L108" } ] } \ No newline at end of file diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 139759c703..75b527a8c4 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5414,6 +5414,13 @@ export interface MappingByteNumberProperty extends MappingNumberPropertyBase { null_value?: byte } +export interface MappingChunkingSettings { + strategy: string + max_chunk_size: integer + overlap?: integer + sentence_overlap?: integer +} + export interface MappingCompletionProperty extends MappingDocValuesPropertyBase { analyzer?: string contexts?: MappingSuggestContext[] @@ -5843,6 +5850,7 @@ export interface MappingSemanticTextProperty { meta?: Record inference_id?: Id search_inference_id?: Id + chunking_settings?: MappingChunkingSettings } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { @@ -22847,13 +22855,13 @@ export interface SpecUtilsCommonQueryParameters { pretty?: boolean } +export interface SpecUtilsOverloadOf { + [key: string]: never +} + export interface SpecUtilsCommonCatQueryParameters { format?: string help?: boolean v?: boolean } -export interface SpecUtilsOverloadOf { - [key: string]: never -} - diff --git a/specification/_types/mapping/ChunkingSettings.ts b/specification/_types/mapping/ChunkingSettings.ts new file mode 100644 index 0000000000..54221ad027 --- /dev/null +++ b/specification/_types/mapping/ChunkingSettings.ts @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { InferenceChunkingSettings } from '@inference/_types/Services' +import { OverloadOf } from '@spec_utils/behaviors' +import { integer } from '@_types/Numeric' + +export class ChunkingSettings implements OverloadOf { + strategy: string + + max_chunk_size: integer + + overlap?: integer + + sentence_overlap?: integer +} diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 0160c8e2d3..dc97deb731 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -38,6 +38,7 @@ import { } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { DateTime } from '@_types/Time' +import { ChunkingSettings } from './ChunkingSettings' import { Property, PropertyBase } from './Property' import { TermVectorOption } from './TermVectorOption' import { TimeSeriesMetricType } from './TimeSeriesMetricType' @@ -232,6 +233,13 @@ export class SemanticTextProperty { * If not specified, the inference endpoint defined by inference_id will be used at both index and query time. */ search_inference_id?: Id + + /** + * Settings for chunking text into smaller passages. If specified, these will override the + * chunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated, + * they will not be applied to existing documents until they are reindexed. + */ + chunking_settings?: ChunkingSettings } export class SearchAsYouTypeProperty extends CorePropertyBase {