Skip to content

Commit

Permalink
[2.5] support bitmap index (#376)
Browse files Browse the repository at this point in the history
* add bitmap index

Signed-off-by: ryjiang <jiangruiyi@gmail.com>

* update test build

Signed-off-by: ryjiang <jiangruiyi@gmail.com>

* disable debug

---------

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
  • Loading branch information
shanghaikid authored Nov 18, 2024
1 parent 7c44b88 commit 69a2e9d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions milvus/const/milvus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export enum IndexType {
STL_SORT = 'STL_SORT',
TRIE = 'Trie',
INVERTED = 'INVERTED',
// 2.5
BITMAP = 'BITMAP',
}

// MsgType
Expand Down
5 changes: 4 additions & 1 deletion milvus/types/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export interface TimeStampArray {
created_utc_timestamps: string[];
}

export type keyValueObj = Record<string, string | number | string[] | number[]>;
export type keyValueObj = Record<
string,
string | number | string[] | number[] | boolean
>;

export interface collectionNameReq extends GrpcTimeOut {
collection_name: string; // required, collection name
Expand Down
12 changes: 11 additions & 1 deletion test/grpc/Index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 69a2e9d

Please sign in to comment.