|
@@ -19,21 +19,31 @@ export class MilvusService {
|
|
}
|
|
}
|
|
|
|
|
|
get collectionManager() {
|
|
get collectionManager() {
|
|
|
|
+ this.checkMilvus();
|
|
return this.milvusClient.collectionManager;
|
|
return this.milvusClient.collectionManager;
|
|
}
|
|
}
|
|
|
|
|
|
get partitionManager() {
|
|
get partitionManager() {
|
|
|
|
+ this.checkMilvus();
|
|
return this.milvusClient.partitionManager;
|
|
return this.milvusClient.partitionManager;
|
|
}
|
|
}
|
|
|
|
|
|
get indexManager() {
|
|
get indexManager() {
|
|
|
|
+ this.checkMilvus();
|
|
return this.milvusClient.indexManager;
|
|
return this.milvusClient.indexManager;
|
|
}
|
|
}
|
|
|
|
|
|
get dataManager() {
|
|
get dataManager() {
|
|
|
|
+ this.checkMilvus();
|
|
return this.milvusClient.dataManager;
|
|
return this.milvusClient.dataManager;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private checkMilvus() {
|
|
|
|
+ if (!this.milvusClient) {
|
|
|
|
+ throw new Error('Please connect milvus first');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
async connectMilvus(address: string) {
|
|
async connectMilvus(address: string) {
|
|
// grpc only need address without http
|
|
// grpc only need address without http
|
|
const milvusAddress = address.replace(/(http|https):\/\//, '');
|
|
const milvusAddress = address.replace(/(http|https):\/\//, '');
|