diff --git a/output/schema/schema.json b/output/schema/schema.json index e964109a02..7e16779108 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -47774,9 +47774,21 @@ "namespace": "_types" } } + }, + { + "description": "Apply oversampling and rescoring to quantized vectors", + "name": "rescore_vector", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RescoreVector", + "namespace": "_types" + } + } } ], - "specLocation": "_types/Knn.ts#L54-L72" + "specLocation": "_types/Knn.ts#L61-L81" }, { "kind": "interface", @@ -47862,9 +47874,21 @@ "namespace": "_types" } } + }, + { + "description": "Apply oversampling and rescoring to quantized vectors", + "name": "rescore_vector", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RescoreVector", + "namespace": "_types" + } + } } ], - "specLocation": "_types/Retriever.ts#L64-L77" + "specLocation": "_types/Retriever.ts#L64-L79" }, { "kind": "interface", @@ -47997,9 +48021,21 @@ "namespace": "_global.search._types" } } + }, + { + "description": "Apply oversampling and rescoring to quantized vectors", + "name": "rescore_vector", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RescoreVector", + "namespace": "_types" + } + } } ], - "specLocation": "_types/Knn.ts#L30-L52" + "specLocation": "_types/Knn.ts#L35-L59" }, { "kind": "interface", @@ -49313,7 +49349,7 @@ } } ], - "specLocation": "_types/Knn.ts#L74-L77", + "specLocation": "_types/Knn.ts#L83-L86", "variants": { "kind": "container" } @@ -49371,7 +49407,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L79-L86" + "specLocation": "_types/Retriever.ts#L81-L88" }, { "kind": "interface", @@ -49705,6 +49741,28 @@ ], "specLocation": "_types/Stats.ts#L247-L253" }, + { + "kind": "interface", + "name": { + "name": "RescoreVector", + "namespace": "_types" + }, + "properties": [ + { + "description": "Applies the specified oversample factor to k on the approximate kNN search", + "name": "oversample", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + } + ], + "specLocation": "_types/Knn.ts#L30-L33" + }, { "kind": "enum", "members": [ @@ -50003,7 +50061,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L101-L110" + "specLocation": "_types/Retriever.ts#L103-L112" }, { "kind": "type_alias", @@ -51899,7 +51957,7 @@ } } ], - "specLocation": "_types/Knn.ts#L79-L82" + "specLocation": "_types/Knn.ts#L88-L91" }, { "kind": "interface", @@ -51975,7 +52033,7 @@ } } ], - "specLocation": "_types/Retriever.ts#L88-L99" + "specLocation": "_types/Retriever.ts#L90-L101" }, { "kind": "enum", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index fb5d902c3c..fbb7f81362 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2500,6 +2500,7 @@ export interface KnnQuery extends QueryDslQueryBase { k?: integer filter?: QueryDslQueryContainer | QueryDslQueryContainer[] similarity?: float + rescore_vector?: RescoreVector } export interface KnnRetriever extends RetrieverBase { @@ -2509,6 +2510,7 @@ export interface KnnRetriever extends RetrieverBase { k: integer num_candidates: integer similarity?: float + rescore_vector?: RescoreVector } export interface KnnSearch { @@ -2521,6 +2523,7 @@ export interface KnnSearch { filter?: QueryDslQueryContainer | QueryDslQueryContainer[] similarity?: float inner_hits?: SearchInnerHits + rescore_vector?: RescoreVector } export interface LatLonGeoLocation { @@ -2701,6 +2704,10 @@ export interface RequestCacheStats { miss_count: long } +export interface RescoreVector { + oversample: float +} + export type Result = 'created' | 'updated' | 'deleted' | 'not_found' | 'noop' export interface Retries { diff --git a/specification/_types/Knn.ts b/specification/_types/Knn.ts index 0735fb45bd..a2bc539889 100644 --- a/specification/_types/Knn.ts +++ b/specification/_types/Knn.ts @@ -27,6 +27,11 @@ export type QueryVector = float[] /* KnnSearch (used in kNN search) and KnnQuery (ued in kNN queries) are close * but different enough to require different classes */ +export interface RescoreVector { + /** Applies the specified oversample factor to k on the approximate kNN search */ + oversample: float +} + export interface KnnSearch { /** The name of the vector field to search against */ field: Field @@ -49,6 +54,8 @@ export interface KnnSearch { * @doc_id knn-inner-hits */ inner_hits?: InnerHits + /** Apply oversampling and rescoring to quantized vectors */ + rescore_vector?: RescoreVector } /** @@ -69,6 +76,8 @@ export interface KnnQuery extends QueryBase { filter?: QueryContainer | QueryContainer[] /** The minimum similarity for a vector to be considered a match */ similarity?: float + /** Apply oversampling and rescoring to quantized vectors */ + rescore_vector?: RescoreVector } /** @variants container */ diff --git a/specification/_types/Retriever.ts b/specification/_types/Retriever.ts index 636f9413fb..73bf634231 100644 --- a/specification/_types/Retriever.ts +++ b/specification/_types/Retriever.ts @@ -19,7 +19,7 @@ import { FieldCollapse } from '@global/search/_types/FieldCollapse' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { QueryVector, QueryVectorBuilder } from '@_types/Knn' +import { QueryVector, QueryVectorBuilder, RescoreVector } from '@_types/Knn' import { float, integer } from '@_types/Numeric' import { Sort, SortResults } from '@_types/sort' import { Id } from './common' @@ -74,6 +74,8 @@ export class KnnRetriever extends RetrieverBase { num_candidates: integer /** The minimum similarity required for a document to be considered a match. */ similarity?: float + /** Apply oversampling and rescoring to quantized vectors */ + rescore_vector?: RescoreVector } export class RRFRetriever extends RetrieverBase {