From 2ad2f16b31d0a37250bd1be990e8b80093d81295 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Wed, 2 Apr 2025 10:01:36 -0400 Subject: [PATCH] Adding bbq index types to specification (#4181) (cherry picked from commit 3e97c19ea994ba17fbdaa94e813b27c345f9bbbd) --- output/openapi/elasticsearch-openapi.json | 6 +++-- .../elasticsearch-serverless-openapi.json | 6 +++-- output/schema/schema-serverless.json | 14 +++++++--- output/schema/schema.json | 14 +++++++--- output/typescript/types.ts | 2 +- package-lock.json | 26 +++++++++---------- package.json | 2 +- .../_types/mapping/DenseVectorProperty.ts | 16 ++++++++++-- 8 files changed, 59 insertions(+), 27 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index ee47200a3f..7669e79ebc 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -68358,11 +68358,11 @@ "type": "number" }, "ef_construction": { - "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "type": "number" }, "m": { - "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "type": "number" }, "type": { @@ -68376,6 +68376,8 @@ "_types.mapping:DenseVectorIndexOptionsType": { "type": "string", "enum": [ + "bbq_flat", + "bbq_hnsw", "flat", "hnsw", "int4_flat", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 027e90569e..baae8cfbf9 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -44945,11 +44945,11 @@ "type": "number" }, "ef_construction": { - "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "type": "number" }, "m": { - "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "type": "number" }, "type": { @@ -44963,6 +44963,8 @@ "_types.mapping:DenseVectorIndexOptionsType": { "type": "string", "enum": [ + "bbq_flat", + "bbq_hnsw", "flat", "hnsw", "int4_flat", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index c72463fb7b..e529081577 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -93100,6 +93100,14 @@ { "kind": "enum", "members": [ + { + "description": "This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors.\nOnly supports `element_type` of `float`.", + "name": "bbq_flat" + }, + { + "description": "This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN\nsearch with `element_type` of `float`.\n\nThis can reduce the memory footprint by nearly 32x at the cost of some accuracy.", + "name": "bbq_hnsw" + }, { "description": "This utilizes a brute-force search algorithm for exact kNN search. This supports all `element_type` values.", "name": "flat" @@ -93129,7 +93137,7 @@ "name": "DenseVectorIndexOptionsType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/DenseVectorProperty.ts#L164-L197" + "specLocation": "_types/mapping/DenseVectorProperty.ts#L164-L209" }, { "kind": "enum", @@ -95691,7 +95699,7 @@ } }, { - "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "name": "ef_construction", "required": false, "serverDefault": 100, @@ -95704,7 +95712,7 @@ } }, { - "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "name": "m", "required": false, "serverDefault": 16, diff --git a/output/schema/schema.json b/output/schema/schema.json index 9c83094df1..1abbccff2b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -77627,7 +77627,7 @@ } }, { - "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of candidates to track while assembling the list of nearest neighbors for each new node.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "name": "ef_construction", "required": false, "serverDefault": 100, @@ -77640,7 +77640,7 @@ } }, { - "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.", + "description": "The number of neighbors each node will be connected to in the HNSW graph.\n\nOnly applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types.", "name": "m", "required": false, "serverDefault": 16, @@ -77670,6 +77670,14 @@ { "kind": "enum", "members": [ + { + "description": "This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors.\nOnly supports `element_type` of `float`.", + "name": "bbq_flat" + }, + { + "description": "This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN\nsearch with `element_type` of `float`.\n\nThis can reduce the memory footprint by nearly 32x at the cost of some accuracy.", + "name": "bbq_hnsw" + }, { "description": "This utilizes a brute-force search algorithm for exact kNN search. This supports all `element_type` values.", "name": "flat" @@ -77699,7 +77707,7 @@ "name": "DenseVectorIndexOptionsType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/DenseVectorProperty.ts#L164-L197" + "specLocation": "_types/mapping/DenseVectorProperty.ts#L164-L209" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ffb36712d7..933199e71c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5472,7 +5472,7 @@ export interface MappingDenseVectorIndexOptions { type: MappingDenseVectorIndexOptionsType } -export type MappingDenseVectorIndexOptionsType = 'flat' | 'hnsw' | 'int4_flat' | 'int4_hnsw' | 'int8_flat' | 'int8_hnsw' +export type MappingDenseVectorIndexOptionsType = 'bbq_flat' | 'bbq_hnsw' | 'flat' | 'hnsw' | 'int4_flat' | 'int4_hnsw' | 'int8_flat' | 'int8_hnsw' export interface MappingDenseVectorProperty extends MappingPropertyBase { type: 'dense_vector' diff --git a/package-lock.json b/package-lock.json index 4388b85a6e..fb9c806bbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@redocly/cli": "^1.34.0", + "@redocly/cli": "^1.34.1", "@stoplight/spectral-cli": "^6.14.2" } }, @@ -489,9 +489,9 @@ } }, "node_modules/@redocly/cli": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.34.0.tgz", - "integrity": "sha512-Kg/t9zMjZB5cyb0YQLa+gne5E5Rz6wZP/goug1+2qaR17UqeupidBzwqDdr3lszEK3q2A37g4+W7pvdBOkiGQA==", + "version": "1.34.1", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.34.1.tgz", + "integrity": "sha512-12aTw7A/0n+8T7yKM1E8qlFRFPZnm2i1me0sZ1WOAiGT4I2j4iUcCp+93B0nrjIs1ZdNmrT0TTrMYLhsMJYjaQ==", "license": "MIT", "dependencies": { "@opentelemetry/api": "1.9.0", @@ -500,8 +500,8 @@ "@opentelemetry/sdk-trace-node": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0", "@redocly/config": "^0.22.0", - "@redocly/openapi-core": "1.34.0", - "@redocly/respect-core": "1.34.0", + "@redocly/openapi-core": "1.34.1", + "@redocly/respect-core": "1.34.1", "abort-controller": "^3.0.0", "chokidar": "^3.5.1", "colorette": "^1.2.0", @@ -564,9 +564,9 @@ "license": "MIT" }, "node_modules/@redocly/openapi-core": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.0.tgz", - "integrity": "sha512-Ji00EiLQRXq0pJIz5pAjGF9MfQvQVsQehc6uIis6sqat8tG/zh25Zi64w6HVGEDgJEzUeq/CuUlD0emu3Hdaqw==", + "version": "1.34.1", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.1.tgz", + "integrity": "sha512-KI1QOGvDk6oREbTu0JORxZX1NBxraXUbXczv0LYDs9EPp06coq874hQORqSHGEUV/DX2A6gjv4Ax33g/LFJBww==", "license": "MIT", "dependencies": { "@redocly/ajv": "^8.11.2", @@ -606,14 +606,14 @@ } }, "node_modules/@redocly/respect-core": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/@redocly/respect-core/-/respect-core-1.34.0.tgz", - "integrity": "sha512-CO2XxJ0SUYHKixKPTQm2U6QrGLnNhQy88CnX20llCxXDKd485cSioRMZ8MMNhHrnDsUlprSuM3ui2z5JGf1ftw==", + "version": "1.34.1", + "resolved": "https://registry.npmjs.org/@redocly/respect-core/-/respect-core-1.34.1.tgz", + "integrity": "sha512-Lzea25WqwxVK5+aCiq/pr7lUFdsZPYSqNzl05Z4jEtuP1DEIxJNG31ID75dZt30pPtyxjaa/dBuccruYlYflzw==", "license": "MIT", "dependencies": { "@faker-js/faker": "^7.6.0", "@redocly/ajv": "8.11.2", - "@redocly/openapi-core": "1.34.0", + "@redocly/openapi-core": "1.34.1", "better-ajv-errors": "^1.2.0", "colorette": "^2.0.20", "concat-stream": "^2.0.0", diff --git a/package.json b/package.json index f9d0d7b82d..65aafaa259 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@redocly/cli": "^1.34.0", + "@redocly/cli": "^1.34.1", "@stoplight/spectral-cli": "^6.14.2" } } diff --git a/specification/_types/mapping/DenseVectorProperty.ts b/specification/_types/mapping/DenseVectorProperty.ts index b861a908d7..c2f2d4646c 100644 --- a/specification/_types/mapping/DenseVectorProperty.ts +++ b/specification/_types/mapping/DenseVectorProperty.ts @@ -144,14 +144,14 @@ export class DenseVectorIndexOptions { /** * The number of candidates to track while assembling the list of nearest neighbors for each new node. * - * Only applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types. + * Only applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types. * @server_default 100 */ ef_construction?: integer /** * The number of neighbors each node will be connected to in the HNSW graph. * - * Only applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types. + * Only applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw` index types. * @server_default 16 */ m?: integer @@ -162,6 +162,18 @@ export class DenseVectorIndexOptions { } export enum DenseVectorIndexOptionsType { + /** + * This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors. + * Only supports `element_type` of `float`. + */ + bbq_flat, + /** + * This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN + * search with `element_type` of `float`. + * + * This can reduce the memory footprint by nearly 32x at the cost of some accuracy. + */ + bbq_hnsw, /** * This utilizes a brute-force search algorithm for exact kNN search. This supports all `element_type` values. */