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

Passing db_name param to the describeCollection() #373

Merged
merged 7 commits into from
Nov 13, 2024
Merged
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
15 changes: 12 additions & 3 deletions milvus/grpc/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
f32ArrayToBinaryBytes,
getValidDataArray,
NO_LIMIT,
DescribeCollectionReq,
} from '../';
import { Collection } from './Collection';

Expand Down Expand Up @@ -465,11 +466,19 @@ export class Data extends Collection {
async search(
data: SearchReq | SearchSimpleReq | HybridSearchReq
): Promise<SearchResults> {
// get collection info
const collectionInfo = await this.describeCollection({
// default collection request
const describeCollectionRequest = {
collection_name: data.collection_name,
cache: true,
});
} as DescribeCollectionReq;

// get collection info
if (data.db_name) {
// if the request has `db_name` pass it to the request.
describeCollectionRequest.db_name = data.db_name;
}

const collectionInfo = await this.describeCollection(describeCollectionRequest);

// build search params
const { request, nq, round_decimal, isHybridSearch } = buildSearchRequest(
Expand Down
Loading