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..c420ba8b 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: 'info' }); // 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,