Skip to content

Commit

Permalink
Passing db_name param to the describeCollection() (#373)
Browse files Browse the repository at this point in the history
* Fix "Cannot read properties of undefined reading nq" because of the database is not passed to `describeCollection` function

* Delete package-lock.json

* Delete yarn.lock

* Revert "Delete yarn.lock"

This reverts commit 9c4d8e5.

* Remove lock files

This reverts commit 8315115.

* Revert "Remove lock files"

This reverts commit 4f23775.

* Remove lock files
  • Loading branch information
rashgaroth authored and shanghaikid committed Dec 16, 2024
1 parent d56effe commit bc7b595
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions milvus/grpc/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import {
getSparseDim,
f32ArrayToBinaryBytes,
NO_LIMIT,
DescribeCollectionReq,
} from '../';
import { Collection } from './Collection';

Expand Down Expand Up @@ -446,11 +447,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

0 comments on commit bc7b595

Please sign in to comment.