diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 1129e9883f..e457803db0 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -62936,10 +62936,17 @@ ] }, "_types.QueryVector": { - "type": "array", - "items": { - "type": "number" - } + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "string" + } + ] }, "_types.QueryVectorBuilder": { "type": "object", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index b46ac50cfe..b7cbf19c0f 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39189,10 +39189,17 @@ ] }, "_types.QueryVector": { - "type": "array", - "items": { - "type": "number" - } + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "string" + } + ] }, "_types.QueryVectorBuilder": { "type": "object", diff --git a/output/schema/schema.json b/output/schema/schema.json index dbffa0b55a..aad7dcb66f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -54087,7 +54087,7 @@ } } ], - "specLocation": "_types/Knn.ts#L64-L87" + "specLocation": "_types/Knn.ts#L65-L88" }, { "kind": "interface", @@ -54346,7 +54346,7 @@ } } ], - "specLocation": "_types/Knn.ts#L35-L62" + "specLocation": "_types/Knn.ts#L36-L63" }, { "kind": "interface", @@ -55809,16 +55809,28 @@ "name": "QueryVector", "namespace": "_types" }, - "specLocation": "_types/Knn.ts#L25-L25", + "specLocation": "_types/Knn.ts#L26-L26", "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" + "kind": "union_of", + "items": [ + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } } - } + ] } }, { @@ -55840,7 +55852,7 @@ } } ], - "specLocation": "_types/Knn.ts#L89-L92", + "specLocation": "_types/Knn.ts#L90-L93", "variants": { "kind": "container" } @@ -56277,7 +56289,7 @@ } } ], - "specLocation": "_types/Knn.ts#L30-L33" + "specLocation": "_types/Knn.ts#L31-L34" }, { "kind": "interface", @@ -58685,7 +58697,7 @@ } } ], - "specLocation": "_types/Knn.ts#L94-L103" + "specLocation": "_types/Knn.ts#L95-L104" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index a90a0dd993..4d99fef7cc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2715,7 +2715,7 @@ export interface QueryCacheStats { total_count: long } -export type QueryVector = float[] +export type QueryVector = float[] | string export interface QueryVectorBuilder { text_embedding?: TextEmbedding diff --git a/specification/_types/Knn.ts b/specification/_types/Knn.ts index f5fef4666a..bf1bcd03c5 100644 --- a/specification/_types/Knn.ts +++ b/specification/_types/Knn.ts @@ -22,7 +22,8 @@ import { float, integer } from '@_types/Numeric' import { InnerHits } from '@global/search/_types/hits' import { QueryBase, QueryContainer } from './query_dsl/abstractions' -export type QueryVector = float[] +/* Byte vectors can be hex-encoded strings */ +export type QueryVector = float[] | string /* KnnSearch (used in kNN search) and KnnQuery (ued in kNN queries) are close * but different enough to require different classes */