From 86d33b48404a4a62a047830c01acce6679b9ceec Mon Sep 17 00:00:00 2001 From: ryjiang Date: Mon, 11 Nov 2024 15:26:41 +0800 Subject: [PATCH 1/2] add bitmap index Signed-off-by: ryjiang --- milvus/const/milvus.ts | 2 ++ milvus/types/Common.ts | 5 ++++- test/grpc/Index.spec.ts | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/milvus/const/milvus.ts b/milvus/const/milvus.ts index 977101ef..f0b73aca 100644 --- a/milvus/const/milvus.ts +++ b/milvus/const/milvus.ts @@ -150,6 +150,8 @@ export enum IndexType { STL_SORT = 'STL_SORT', TRIE = 'Trie', INVERTED = 'INVERTED', + // 2.5 + BITMAP = 'BITMAP', } // MsgType diff --git a/milvus/types/Common.ts b/milvus/types/Common.ts index 05f8a7db..08b839c8 100644 --- a/milvus/types/Common.ts +++ b/milvus/types/Common.ts @@ -58,7 +58,10 @@ export interface TimeStampArray { created_utc_timestamps: string[]; } -export type keyValueObj = Record; +export type keyValueObj = Record< + string, + string | number | string[] | number[] | boolean +>; export interface collectionNameReq extends GrpcTimeOut { collection_name: string; // required, collection name diff --git a/test/grpc/Index.spec.ts b/test/grpc/Index.spec.ts index 83e0e593..e3b2e4f6 100644 --- a/test/grpc/Index.spec.ts +++ b/test/grpc/Index.spec.ts @@ -14,7 +14,7 @@ import { } from '../tools'; import { timeoutTest } from '../tools'; -const milvusClient = new MilvusClient({ address: IP }); +const milvusClient = new MilvusClient({ address: IP, logLevel: 'debug' }); // names const COLLECTION_NAME = GENERATE_NAME(); const COLLECTION_NAME_WITHOUT_INDEX_NAME = GENERATE_NAME(); @@ -271,6 +271,16 @@ describe(`Milvus Index API`, () => { expect(res.error_code).toEqual(ErrorCode.SUCCESS); }); + it(`Create Bitmap index on int32_array array should success`, async () => { + const res = await milvusClient.createIndex({ + index_name: 'bitmap_index', + collection_name: COLLECTION_NAME, + field_name: 'int32_array', + index_type: IndexType.BITMAP, + }); + expect(res.error_code).toEqual(ErrorCode.SUCCESS); + }); + it(`Create Index without name should success`, async () => { const res = await milvusClient.createIndex({ collection_name: COLLECTION_NAME_WITHOUT_INDEX_NAME, From 3089607e83237647e3e8ff32eb9dd260d212507e Mon Sep 17 00:00:00 2001 From: ryjiang Date: Wed, 13 Nov 2024 19:13:43 +0800 Subject: [PATCH 2/2] update test build Signed-off-by: ryjiang --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e28c53ef..f9bd196b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@zilliz/milvus2-sdk-node", "author": "ued@zilliz.com", - "milvusVersion": "master-20241105-bd04cac4-amd64", + "milvusVersion": "master-20241113-af433ffd-amd64", "version": "2.4.9", "main": "dist/milvus", "files": [