diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 692f131b29..432b73d992 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -62965,10 +62965,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 d921f60720..778a64bdbf 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39328,10 +39328,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 923aee4294..603bcad9f9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -54583,7 +54583,7 @@ } } ], - "specLocation": "_types/Knn.ts#L69-L97" + "specLocation": "_types/Knn.ts#L70-L98" }, { "kind": "interface", @@ -54878,7 +54878,7 @@ } } ], - "specLocation": "_types/Knn.ts#L35-L67" + "specLocation": "_types/Knn.ts#L36-L68" }, { "kind": "interface", @@ -56341,16 +56341,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" + } } - } + ] } }, { @@ -56372,7 +56384,7 @@ } } ], - "specLocation": "_types/Knn.ts#L99-L102", + "specLocation": "_types/Knn.ts#L100-L103", "variants": { "kind": "container" } @@ -56877,7 +56889,7 @@ } } ], - "specLocation": "_types/Knn.ts#L30-L33" + "specLocation": "_types/Knn.ts#L31-L34" }, { "kind": "interface", @@ -59285,7 +59297,7 @@ } } ], - "specLocation": "_types/Knn.ts#L104-L113" + "specLocation": "_types/Knn.ts#L105-L114" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 8c95fa5b9e..961c3da98f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2718,7 +2718,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 541411301f..26b0eec20e 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 */