Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.5] add bitmap index #372

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zilliz/milvus2-sdk-node",
"author": "[email protected]",
"milvusVersion": "master-20241105-bd04cac4-amd64",
"milvusVersion": "master-20241113-af433ffd-amd64",
"version": "2.4.9",
"main": "dist/milvus",
"files": [
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: 'debug' });
// 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
Loading