From c3b758eaffca6a50202927ba8d04c452b562e68c Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Wed, 2 Jul 2025 16:54:28 -0400 Subject: [PATCH 1/2] add sparse vector index options to specification # Conflicts: # output/schema/schema.json --- output/openapi/elasticsearch-openapi.json | 16 +++ .../elasticsearch-serverless-openapi.json | 16 +++ output/schema/schema.json | 134 +++++++++++++----- output/typescript/types.ts | 6 + .../mapping/SparseVectorIndexOptions.ts | 42 ++++++ specification/_types/mapping/core.ts | 8 ++ 6 files changed, 188 insertions(+), 34 deletions(-) create mode 100644 specification/_types/mapping/SparseVectorIndexOptions.ts diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8b129e013a..1ef3442554 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -72264,6 +72264,9 @@ "enum": [ "sparse_vector" ] + }, + "index_options": { + "$ref": "#/components/schemas/_types.mapping.SparseVectorIndexOptions" } }, "required": [ @@ -72272,6 +72275,19 @@ } ] }, + "_types.mapping.SparseVectorIndexOptions": { + "type": "object", + "properties": { + "prune": { + "description": "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false", + "x-state": "Generally available; Added in 8.19.0", + "type": "boolean" + }, + "pruning_config": { + "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + } + } + }, "_types.mapping.CompletionProperty": { "allOf": [ { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 6282a76aaf..974115b1a5 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47965,6 +47965,9 @@ "enum": [ "sparse_vector" ] + }, + "index_options": { + "$ref": "#/components/schemas/_types.mapping.SparseVectorIndexOptions" } }, "required": [ @@ -47973,6 +47976,19 @@ } ] }, + "_types.mapping.SparseVectorIndexOptions": { + "type": "object", + "properties": { + "prune": { + "description": "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false", + "x-state": "Generally available", + "type": "boolean" + }, + "pruning_config": { + "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + } + } + }, "_types.mapping.CompletionProperty": { "allOf": [ { diff --git a/output/schema/schema.json b/output/schema/schema.json index b066c4ec06..7178b89c13 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -81638,7 +81638,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L56-L58" + "specLocation": "_types/mapping/core.ts#L57-L59" }, { "kind": "interface", @@ -81759,7 +81759,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L60-L75" + "specLocation": "_types/mapping/core.ts#L61-L76" }, { "kind": "interface", @@ -81794,7 +81794,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L187-L190" + "specLocation": "_types/mapping/core.ts#L188-L191" }, { "kind": "interface", @@ -82059,7 +82059,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L47-L50" + "specLocation": "_types/mapping/core.ts#L48-L51" }, { "kind": "interface", @@ -82227,7 +82227,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L91-L101" + "specLocation": "_types/mapping/core.ts#L92-L102" }, { "kind": "interface", @@ -82361,7 +82361,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L77-L89" + "specLocation": "_types/mapping/core.ts#L78-L90" }, { "kind": "interface", @@ -82693,7 +82693,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L52-L54" + "specLocation": "_types/mapping/core.ts#L53-L55" }, { "kind": "interface", @@ -82728,7 +82728,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L167-L170" + "specLocation": "_types/mapping/core.ts#L168-L171" }, { "kind": "interface", @@ -83053,7 +83053,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L352-L383" + "specLocation": "_types/mapping/core.ts#L360-L391" }, { "kind": "interface", @@ -83687,7 +83687,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L157-L160" + "specLocation": "_types/mapping/core.ts#L158-L161" }, { "kind": "interface", @@ -84001,7 +84001,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L162-L165" + "specLocation": "_types/mapping/core.ts#L163-L166" }, { "kind": "interface", @@ -84281,7 +84281,7 @@ "name": "IndexOptions", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L308-L313" + "specLocation": "_types/mapping/core.ts#L316-L321" }, { "kind": "interface", @@ -84316,7 +84316,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L172-L175" + "specLocation": "_types/mapping/core.ts#L173-L176" }, { "kind": "interface", @@ -84546,7 +84546,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L103-L107" + "specLocation": "_types/mapping/core.ts#L104-L108" }, { "kind": "interface", @@ -84723,7 +84723,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L109-L128" + "specLocation": "_types/mapping/core.ts#L110-L129" }, { "kind": "interface", @@ -84758,7 +84758,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L177-L180" + "specLocation": "_types/mapping/core.ts#L178-L181" }, { "kind": "interface", @@ -84863,7 +84863,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L281-L306" + "specLocation": "_types/mapping/core.ts#L289-L314" }, { "kind": "enum", @@ -85083,7 +85083,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L130-L150" + "specLocation": "_types/mapping/core.ts#L131-L151" }, { "kind": "interface", @@ -85145,7 +85145,7 @@ "name": "OnScriptError", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L152-L155" + "specLocation": "_types/mapping/core.ts#L153-L156" }, { "kind": "interface", @@ -85226,7 +85226,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L203-L205" + "specLocation": "_types/mapping/core.ts#L204-L206" }, { "kind": "interface", @@ -85862,7 +85862,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L207-L210" + "specLocation": "_types/mapping/core.ts#L208-L211" }, { "kind": "interface", @@ -85897,7 +85897,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L212-L215" + "specLocation": "_types/mapping/core.ts#L213-L216" }, { "kind": "enum", @@ -85916,7 +85916,7 @@ "name": "RankVectorElementType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/core.ts#L385-L389" + "specLocation": "_types/mapping/core.ts#L393-L397" }, { "kind": "interface", @@ -85963,7 +85963,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L217-L224" + "specLocation": "_types/mapping/core.ts#L218-L225" }, { "kind": "interface", @@ -86251,7 +86251,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L197-L201" + "specLocation": "_types/mapping/core.ts#L198-L202" }, { "kind": "interface", @@ -86386,7 +86386,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L262-L273" + "specLocation": "_types/mapping/core.ts#L270-L281" }, { "kind": "interface", @@ -86496,7 +86496,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L231-L260" + "specLocation": "_types/mapping/core.ts#L239-L268" }, { "kind": "interface", @@ -86602,7 +86602,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L182-L185" + "specLocation": "_types/mapping/core.ts#L183-L186" }, { "kind": "interface", @@ -86727,6 +86727,54 @@ }, "specLocation": "_types/mapping/meta-fields.ts#L67-L75" }, + { + "kind": "interface", + "name": { + "name": "SparseVectorIndexOptions", + "namespace": "_types.mapping" + }, + "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.19.0" + } + }, + "containerProperty": true, + "description": "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false", + "name": "prune", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.19.0" + } + }, + "containerProperty": true, + "description": "Optional pruning configuration.\nIf enabled, this will omit non-significant tokens from the query in order to improve query performance.\nThis is only used if prune is set to true.\nIf prune is set to true but pruning_config is not specified, default values will be used.", + "name": "pruning_config", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TokenPruningConfig", + "namespace": "_types.query_dsl" + } + } + } + ], + "specLocation": "_types/mapping/SparseVectorIndexOptions.ts#L22-L42" + }, { "kind": "interface", "inherits": { @@ -86758,9 +86806,27 @@ "kind": "literal_value", "value": "sparse_vector" } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.19.0" + } + }, + "description": "Additional index options for the sparse vector field that controls the\ntoken pruning behavior of the sparse vector field.", + "name": "index_options", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SparseVectorIndexOptions", + "namespace": "_types.mapping" + } + } } ], - "specLocation": "_types/mapping/core.ts#L226-L229" + "specLocation": "_types/mapping/core.ts#L227-L237" }, { "kind": "enum", @@ -86938,7 +87004,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L315-L318" + "specLocation": "_types/mapping/core.ts#L323-L326" }, { "kind": "interface", @@ -87151,7 +87217,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L320-L337" + "specLocation": "_types/mapping/core.ts#L328-L345" }, { "kind": "enum", @@ -87534,7 +87600,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L192-L195" + "specLocation": "_types/mapping/core.ts#L193-L196" }, { "kind": "interface", @@ -87558,7 +87624,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L339-L341" + "specLocation": "_types/mapping/core.ts#L347-L349" }, { "kind": "interface", @@ -87599,7 +87665,7 @@ } } ], - "specLocation": "_types/mapping/core.ts#L343-L350" + "specLocation": "_types/mapping/core.ts#L351-L358" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6886c9aae0..ac526db73c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6022,9 +6022,15 @@ export interface MappingSourceField { export type MappingSourceFieldMode = 'disabled' | 'stored' | 'synthetic' +export interface MappingSparseVectorIndexOptions { + prune?: boolean + pruning_config?: QueryDslTokenPruningConfig +} + export interface MappingSparseVectorProperty extends MappingPropertyBase { store?: boolean type: 'sparse_vector' + index_options?: MappingSparseVectorIndexOptions } export type MappingSubobjects = boolean | 'true' | 'false' | 'auto' diff --git a/specification/_types/mapping/SparseVectorIndexOptions.ts b/specification/_types/mapping/SparseVectorIndexOptions.ts new file mode 100644 index 0000000000..c02a470657 --- /dev/null +++ b/specification/_types/mapping/SparseVectorIndexOptions.ts @@ -0,0 +1,42 @@ +/* + * 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 { TokenPruningConfig } from '@_types/query_dsl/TokenPruningConfig' + +export class SparseVectorIndexOptions { + /** + * Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. + * If prune is true but the pruning_config is not specified, pruning will occur but default values will be used. + * Default: false + * @availability stack since=8.19.0 + * @availability serverless + * @variant container_property + */ + prune?: boolean + /** + * Optional pruning configuration. + * If enabled, this will omit non-significant tokens from the query in order to improve query performance. + * This is only used if prune is set to true. + * If prune is set to true but pruning_config is not specified, default values will be used. + * @availability stack since=8.19.0 + * @availability serverless + * @variant container_property + */ + pruning_config?: TokenPruningConfig +} diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 08bf088956..6a178c2ba5 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -41,6 +41,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { ChunkingSettings } from './ChunkingSettings' import { Property, PropertyBase } from './Property' import { SemanticTextIndexOptions } from './SemanticTextIndexOptions' +import { SparseVectorIndexOptions } from './SparseVectorIndexOptions' import { TermVectorOption } from './TermVectorOption' import { TimeSeriesMetricType } from './TimeSeriesMetricType' @@ -226,6 +227,13 @@ export class RankVectorProperty extends PropertyBase { export class SparseVectorProperty extends PropertyBase { store?: boolean type: 'sparse_vector' + /** + * Additional index options for the sparse vector field that controls the + * token pruning behavior of the sparse vector field. + * @availability stack since=8.19.0 + * @availability serverless + */ + index_options?: SparseVectorIndexOptions } export class SemanticTextProperty { From 4f7d913ce0ccda3df1357e20d7da1952be6d7f43 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Thu, 3 Jul 2025 12:58:29 -0400 Subject: [PATCH 2/2] move TokenPruningConfig to base _types level --- output/openapi/elasticsearch-openapi.json | 10 +- .../elasticsearch-serverless-openapi.json | 10 +- output/schema/schema.json | 106 +++++++++--------- output/typescript/types.ts | 20 ++-- .../{query_dsl => }/TokenPruningConfig.ts | 0 .../mapping/SparseVectorIndexOptions.ts | 2 +- .../_types/query_dsl/SparseVectorQuery.ts | 2 +- .../_types/query_dsl/TextExpansionQuery.ts | 2 +- .../_types/query_dsl/WeightedTokensQuery.ts | 2 +- 9 files changed, 77 insertions(+), 77 deletions(-) rename specification/_types/{query_dsl => }/TokenPruningConfig.ts (100%) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 249960c0ce..da6965c918 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -56286,7 +56286,7 @@ "type": "boolean" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -56314,7 +56314,7 @@ } ] }, - "_types.query_dsl.TokenPruningConfig": { + "_types.TokenPruningConfig": { "type": "object", "properties": { "tokens_freq_ratio_threshold": { @@ -56412,7 +56412,7 @@ "type": "string" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -56451,7 +56451,7 @@ ] }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -72292,7 +72292,7 @@ "type": "boolean" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 572635dfa9..60e31eb566 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -34940,7 +34940,7 @@ "type": "boolean" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -34968,7 +34968,7 @@ } ] }, - "_types.query_dsl.TokenPruningConfig": { + "_types.TokenPruningConfig": { "type": "object", "properties": { "tokens_freq_ratio_threshold": { @@ -35066,7 +35066,7 @@ "type": "string" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -35105,7 +35105,7 @@ ] }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } }, "required": [ @@ -47993,7 +47993,7 @@ "type": "boolean" }, "pruning_config": { - "$ref": "#/components/schemas/_types.query_dsl.TokenPruningConfig" + "$ref": "#/components/schemas/_types.TokenPruningConfig" } } }, diff --git a/output/schema/schema.json b/output/schema/schema.json index b7e06a5aa5..dacdb63730 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -57999,6 +57999,55 @@ } } }, + { + "kind": "interface", + "name": { + "name": "TokenPruningConfig", + "namespace": "_types" + }, + "properties": [ + { + "description": "Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.", + "name": "tokens_freq_ratio_threshold", + "required": false, + "serverDefault": 5, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Tokens whose weight is less than this threshold are considered nonsignificant and pruned.", + "name": "tokens_weight_threshold", + "required": false, + "serverDefault": 0.4, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "description": "Whether to only score pruned tokens, vs only scoring kept tokens.", + "name": "only_score_pruned_tokens", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "_types/TokenPruningConfig.ts#L22-L35" + }, { "kind": "interface", "name": { @@ -86772,7 +86821,7 @@ "kind": "instance_of", "type": { "name": "TokenPruningConfig", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -95843,7 +95892,7 @@ "kind": "instance_of", "type": { "name": "TokenPruningConfig", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -96194,7 +96243,7 @@ "kind": "instance_of", "type": { "name": "TokenPruningConfig", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -96235,55 +96284,6 @@ }, "specLocation": "_types/query_dsl/fulltext.ts#L610-L636" }, - { - "kind": "interface", - "name": { - "name": "TokenPruningConfig", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "description": "Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.", - "name": "tokens_freq_ratio_threshold", - "required": false, - "serverDefault": 5, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "Tokens whose weight is less than this threshold are considered nonsignificant and pruned.", - "name": "tokens_weight_threshold", - "required": false, - "serverDefault": 0.4, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "description": "Whether to only score pruned tokens, vs only scoring kept tokens.", - "name": "only_score_pruned_tokens", - "required": false, - "serverDefault": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "_types/query_dsl/TokenPruningConfig.ts#L22-L35" - }, { "kind": "interface", "inherits": { @@ -96477,7 +96477,7 @@ "kind": "instance_of", "type": { "name": "TokenPruningConfig", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ac526db73c..b954626aeb 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2987,6 +2987,12 @@ export type TimeUnit = 'nanos' | 'micros' | 'ms' | 's' | 'm' | 'h' | 'd' export type TimeZone = string +export interface TokenPruningConfig { + tokens_freq_ratio_threshold?: integer + tokens_weight_threshold?: float + only_score_pruned_tokens?: boolean +} + export interface TopLeftBottomRightGeoBounds { top_left: GeoLocation bottom_right: GeoLocation @@ -6024,7 +6030,7 @@ export type MappingSourceFieldMode = 'disabled' | 'stored' | 'synthetic' export interface MappingSparseVectorIndexOptions { prune?: boolean - pruning_config?: QueryDslTokenPruningConfig + pruning_config?: TokenPruningConfig } export interface MappingSparseVectorProperty extends MappingPropertyBase { @@ -6861,7 +6867,7 @@ export interface QueryDslSparseVectorQuery extends QueryDslQueryBase { inference_id?: Id query?: string prune?: boolean - pruning_config?: QueryDslTokenPruningConfig + pruning_config?: TokenPruningConfig } export interface QueryDslTermQuery extends QueryDslQueryBase { @@ -6896,17 +6902,11 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase { export interface QueryDslTextExpansionQuery extends QueryDslQueryBase { model_id: string model_text: string - pruning_config?: QueryDslTokenPruningConfig + pruning_config?: TokenPruningConfig } export type QueryDslTextQueryType = 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix' | 'bool_prefix' -export interface QueryDslTokenPruningConfig { - tokens_freq_ratio_threshold?: integer - tokens_weight_threshold?: float - only_score_pruned_tokens?: boolean -} - export interface QueryDslTypeQuery extends QueryDslQueryBase { value: string } @@ -6926,7 +6926,7 @@ export interface QueryDslUntypedRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslWeightedTokensQuery extends QueryDslQueryBase { tokens: Record | Record[] - pruning_config?: QueryDslTokenPruningConfig + pruning_config?: TokenPruningConfig } export interface QueryDslWildcardQuery extends QueryDslQueryBase { diff --git a/specification/_types/query_dsl/TokenPruningConfig.ts b/specification/_types/TokenPruningConfig.ts similarity index 100% rename from specification/_types/query_dsl/TokenPruningConfig.ts rename to specification/_types/TokenPruningConfig.ts diff --git a/specification/_types/mapping/SparseVectorIndexOptions.ts b/specification/_types/mapping/SparseVectorIndexOptions.ts index c02a470657..e7a650a3a2 100644 --- a/specification/_types/mapping/SparseVectorIndexOptions.ts +++ b/specification/_types/mapping/SparseVectorIndexOptions.ts @@ -17,7 +17,7 @@ * under the License. */ -import { TokenPruningConfig } from '@_types/query_dsl/TokenPruningConfig' +import { TokenPruningConfig } from '@_types/TokenPruningConfig' export class SparseVectorIndexOptions { /** diff --git a/specification/_types/query_dsl/SparseVectorQuery.ts b/specification/_types/query_dsl/SparseVectorQuery.ts index c2164bb3db..b1a6129754 100644 --- a/specification/_types/query_dsl/SparseVectorQuery.ts +++ b/specification/_types/query_dsl/SparseVectorQuery.ts @@ -20,8 +20,8 @@ import { Field, Id } from '@_types/common' import { float } from '@_types/Numeric' import { Dictionary } from '@spec_utils/Dictionary' +import { TokenPruningConfig } from '../TokenPruningConfig' import { QueryBase } from './abstractions' -import { TokenPruningConfig } from './TokenPruningConfig' /** * @variants container diff --git a/specification/_types/query_dsl/TextExpansionQuery.ts b/specification/_types/query_dsl/TextExpansionQuery.ts index 238c079349..7d55520c5e 100644 --- a/specification/_types/query_dsl/TextExpansionQuery.ts +++ b/specification/_types/query_dsl/TextExpansionQuery.ts @@ -17,8 +17,8 @@ * under the License. */ +import { TokenPruningConfig } from '../TokenPruningConfig' import { QueryBase } from './abstractions' -import { TokenPruningConfig } from './TokenPruningConfig' /** * @ext_doc_id query-dsl-text-expansion-query diff --git a/specification/_types/query_dsl/WeightedTokensQuery.ts b/specification/_types/query_dsl/WeightedTokensQuery.ts index 17f965510f..42fc4ab205 100644 --- a/specification/_types/query_dsl/WeightedTokensQuery.ts +++ b/specification/_types/query_dsl/WeightedTokensQuery.ts @@ -19,8 +19,8 @@ import { float } from '@_types/Numeric' import { Dictionary } from '@spec_utils/Dictionary' +import { TokenPruningConfig } from '../TokenPruningConfig' import { QueryBase } from './abstractions' -import { TokenPruningConfig } from './TokenPruningConfig' /** * @ext_doc_id query-dsl-weighted-tokens-query