@zilliz/milvus2-sdk-node 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -13
- package/dist/milvus/BaseClient.d.ts +9 -8
- package/dist/milvus/BaseClient.js +47 -18
- package/dist/milvus/BaseClient.js.map +1 -1
- package/dist/milvus/Collection.d.ts +49 -49
- package/dist/milvus/Collection.js +105 -91
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +10 -22
- package/dist/milvus/Data.js +96 -90
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/MilvusClient.js +2 -2
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/MilvusIndex.d.ts +46 -46
- package/dist/milvus/MilvusIndex.js +59 -51
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.js +7 -7
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/Resource.js +6 -6
- package/dist/milvus/Resource.js.map +1 -1
- package/dist/milvus/User.js +15 -15
- package/dist/milvus/User.js.map +1 -1
- package/dist/milvus/const/ErrorReason.d.ts +29 -32
- package/dist/milvus/const/ErrorReason.js +29 -32
- package/dist/milvus/const/ErrorReason.js.map +1 -1
- package/dist/milvus/const/Milvus.d.ts +2 -0
- package/dist/milvus/const/Milvus.js +7 -1
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/index.d.ts +1 -0
- package/dist/milvus/index.js +1 -0
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +9 -0
- package/dist/milvus/types/Client.js +3 -0
- package/dist/milvus/types/Client.js.map +1 -0
- package/dist/milvus/types/Common.d.ts +3 -0
- package/dist/milvus/types/Data.d.ts +13 -2
- package/dist/milvus/types/Index.d.ts +9 -1
- package/dist/milvus/types.d.ts +1 -0
- package/dist/milvus/types.js +1 -0
- package/dist/milvus/types.js.map +1 -1
- package/dist/proto/proto/common.proto +1 -0
- package/dist/proto/proto/google/protobuf/descriptor.proto +19 -3
- package/dist/proto/proto/milvus.proto +24 -0
- package/dist/proto/proto/schema.proto +13 -1
- package/dist/sdk.json +1 -1
- package/dist/utils/Format.d.ts +8 -0
- package/dist/utils/Format.js +31 -1
- package/dist/utils/Format.js.map +1 -1
- package/dist/utils/Function.d.ts +9 -1
- package/dist/utils/Function.js +18 -5
- package/dist/utils/Function.js.map +1 -1
- package/dist/utils/Validate.d.ts +7 -1
- package/dist/utils/Validate.js +64 -18
- package/dist/utils/Validate.js.map +1 -1
- package/dist/utils/test.d.ts +8 -7
- package/dist/utils/test.js +48 -18
- package/dist/utils/test.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
# Milvus2-sdk-node
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The official [Milvus](https://github.com/milvus-io/milvus) client for Node.js.
|
|
9
9
|
|
|
10
10
|
## Compatibility
|
|
11
11
|
|
|
@@ -25,19 +25,178 @@ The following collection shows Milvus versions and recommended @zilliz/milvus2-s
|
|
|
25
25
|
|
|
26
26
|
## Installation
|
|
27
27
|
|
|
28
|
+
The recommended way to get started using the Milvus node.js client is by using npm (Node package manager) to install the dependency in your project.
|
|
29
|
+
|
|
28
30
|
```javascript
|
|
29
31
|
npm install @zilliz/milvus2-sdk-node
|
|
32
|
+
# or ...
|
|
33
|
+
yarn add @zilliz/milvus2-sdk-node
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This will download the Milvus node.js client and add a dependency entry in your package.json file.
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
This guide will show you how to set up a simple application using Node.js and Milvus. Its scope is only how to set up the node.js client and perform the simple CRUD operations. For more in-depth coverage, see the [Milvus official website](https://milvus.io/).
|
|
41
|
+
|
|
42
|
+
### Create the package.json file
|
|
43
|
+
|
|
44
|
+
First, create a directory where your application will live.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
mkdir myProject
|
|
48
|
+
cd myProject
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Enter the following command and answer the questions to create the initial structure for your new project:
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
npm init -y
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Next, install this client as a dependency.
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
npm install @zilliz/milvus2-sdk-node
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Start a milvus server
|
|
64
|
+
|
|
65
|
+
```shell
|
|
66
|
+
# Download the milvus standalone yaml file
|
|
67
|
+
$ wget https://github.com/milvus-io/milvus/releases/download/v2.2.6/milvus-standalone-docker-compose.yml -O docker-compose.yml
|
|
68
|
+
|
|
69
|
+
# start the milvus server
|
|
70
|
+
sudo docker-compose up -d
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Connect to Milvus
|
|
74
|
+
|
|
75
|
+
Create a new app.js file and add the following code to try out some basic vector operations using the Milvus node.js client.
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import { MilvusClient, DataType } from '@zilliz/milvus2-sdk-node';
|
|
79
|
+
|
|
80
|
+
const IP = 'your-milvus-ip';
|
|
81
|
+
|
|
82
|
+
// connect to milvus
|
|
83
|
+
const client = new MilvusClient(IP);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### define schema for collection
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
// define schema
|
|
90
|
+
const collection_name = `book`;
|
|
91
|
+
const dim = 128;
|
|
92
|
+
const schema = [
|
|
93
|
+
{
|
|
94
|
+
name: `book_id`,
|
|
95
|
+
description: `customized primary id`,
|
|
96
|
+
data_type: DataType.Int64,
|
|
97
|
+
is_primary_key: true,
|
|
98
|
+
autoID: false,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: `word_count`,
|
|
102
|
+
description: `word count`,
|
|
103
|
+
data_type: DataType.Int64,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: `book_intro`,
|
|
107
|
+
description: `word count`,
|
|
108
|
+
data_type: DataType.FloatVector,
|
|
109
|
+
type_params: {
|
|
110
|
+
dim: dim,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### create collection
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
await client.createCollection({
|
|
120
|
+
collection_name,
|
|
121
|
+
description: `my first collection`,
|
|
122
|
+
fields: schema,
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### prepare data
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
// generate mock data
|
|
130
|
+
const fields_data = [];
|
|
131
|
+
|
|
132
|
+
// generate mock data
|
|
133
|
+
for (let i = 0; i < 1000; i++) {
|
|
134
|
+
// create a new object with random values for each field
|
|
135
|
+
const r = {
|
|
136
|
+
book_id: Math.floor(Math.random() * 100000), // generate a random book ID
|
|
137
|
+
word_count: Math.floor(Math.random() * 1000), // generate a random word count
|
|
138
|
+
book_intro: [...Array(dim)].map(() => Math.random()), // generate a random vector for book_intro
|
|
139
|
+
};
|
|
140
|
+
// add the new object to the fields_data array
|
|
141
|
+
fields_data.push(r);
|
|
142
|
+
}
|
|
30
143
|
```
|
|
31
144
|
|
|
32
|
-
|
|
145
|
+
### insert data into collection
|
|
33
146
|
|
|
34
|
-
|
|
147
|
+
```javascript
|
|
148
|
+
await client.insert({
|
|
149
|
+
collection_name,
|
|
150
|
+
fields_data,
|
|
151
|
+
});
|
|
152
|
+
```
|
|
35
153
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
154
|
+
### create index and load collection into memory
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
// create index
|
|
158
|
+
await client.createIndex({
|
|
159
|
+
collection_name,
|
|
160
|
+
field_name: 'book_intro',
|
|
161
|
+
index_name: 'myindex',
|
|
162
|
+
extra_params: {
|
|
163
|
+
index_type: 'IVF_FLAT',
|
|
164
|
+
metric_type: 'L2',
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
// load collection
|
|
168
|
+
await client.loadCollectionSync({
|
|
169
|
+
collection_name,
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### vector search
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
// Generate a random search vector
|
|
177
|
+
const searchVector = [...Array(dim)].map(() => Math.random());
|
|
178
|
+
|
|
179
|
+
// Perform a vector search on the collection
|
|
180
|
+
const res = await client.search({
|
|
181
|
+
collection_name,
|
|
182
|
+
vectors: [searchVector],
|
|
183
|
+
search_params: {
|
|
184
|
+
anns_field: 'book_intro', // specify the field to search on
|
|
185
|
+
metric_type: 'L2', // specify the distance metric to use
|
|
186
|
+
params: JSON.stringify({ nprobe: 64 }), // specify the search parameters
|
|
187
|
+
topk: 1, // specify the number of nearest neighbors to return
|
|
188
|
+
},
|
|
189
|
+
output_fields: ['book_id', 'word_count'], // specify the fields to return in the search results
|
|
190
|
+
vector_type: DataType.FloatVector, // specify the data type of the vectors
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Next Steps
|
|
195
|
+
|
|
196
|
+
- [What is Milvus](https://milvus.io/)
|
|
197
|
+
- [Milvus Node SDK API reference](https://milvus.io/api-reference/node/v2.2.x/About.md)
|
|
198
|
+
- [Attu, Milvus GUI tool, based on Milvus node.js SDK](https://github.com/zilliztech/attu)
|
|
199
|
+
- [Feder, anns index visuliazation tool](https://github.com/zilliztech/feder)
|
|
41
200
|
|
|
42
201
|
## How to contribute
|
|
43
202
|
|
|
@@ -47,8 +206,3 @@ More documentation, you can refer [Milvus offical website](https://milvus.io/).
|
|
|
47
206
|
2. `git submodule update --remote`
|
|
48
207
|
3. Add feature in milvus folder.
|
|
49
208
|
4. Run test `yarn test -- test/Your-test-for-your-feature.spec.ts`
|
|
50
|
-
|
|
51
|
-
## Others
|
|
52
|
-
|
|
53
|
-
- [Attu](https://github.com/zilliztech/attu) which is a Milvus web interface tool, depends on Milvus node.js SDK.
|
|
54
|
-
- [Feder](https://github.com/zilliztech/feder) which is a visualization tool for visualize hnsw, faiss and other index.
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { Root } from 'protobufjs';
|
|
2
|
-
import { Client } from '@grpc/grpc-js';
|
|
2
|
+
import { Client, ChannelOptions } from '@grpc/grpc-js';
|
|
3
|
+
import { MilvusClientConfig } from '.';
|
|
3
4
|
export declare class BaseClient {
|
|
4
5
|
schemaProto: Root;
|
|
5
6
|
milvusProto: Root;
|
|
6
7
|
grpcClient: Client;
|
|
8
|
+
timeout: number;
|
|
7
9
|
/**
|
|
8
|
-
* Connect to
|
|
9
|
-
*
|
|
10
|
-
* @param address milvus address like: 127.0.0.1:19530
|
|
11
|
-
* @param ssl ssl connect or not, default is false
|
|
12
|
-
* @param username After created user in Milvus, username is required
|
|
13
|
-
* @param password After created user in Milvus, password is required
|
|
10
|
+
* Connect to a Milvus gRPC client.
|
|
14
11
|
*
|
|
12
|
+
* @param configOrAddress The configuration object or the Milvus address as a string.
|
|
13
|
+
* @param ssl Whether to use SSL or not. Default is false.
|
|
14
|
+
* @param username The username for authentication. Required if password is provided.
|
|
15
|
+
* @param password The password for authentication. Required if username is provided.
|
|
15
16
|
*/
|
|
16
|
-
constructor(
|
|
17
|
+
constructor(configOrAddress: MilvusClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions);
|
|
17
18
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -9,27 +20,40 @@ var protobufjs_1 = __importDefault(require("protobufjs"));
|
|
|
9
20
|
var grpc_js_1 = require("@grpc/grpc-js");
|
|
10
21
|
var _1 = require(".");
|
|
11
22
|
var utils_1 = require("../utils");
|
|
12
|
-
//
|
|
23
|
+
// path
|
|
13
24
|
var protoPath = path_1.default.resolve(__dirname, '../proto/proto/milvus.proto');
|
|
14
25
|
var schemaProtoPath = path_1.default.resolve(__dirname, '../proto/proto/schema.proto');
|
|
15
26
|
// Base Client
|
|
16
27
|
var BaseClient = /** @class */ (function () {
|
|
17
28
|
/**
|
|
18
|
-
* Connect to
|
|
19
|
-
*
|
|
20
|
-
* @param address milvus address like: 127.0.0.1:19530
|
|
21
|
-
* @param ssl ssl connect or not, default is false
|
|
22
|
-
* @param username After created user in Milvus, username is required
|
|
23
|
-
* @param password After created user in Milvus, password is required
|
|
29
|
+
* Connect to a Milvus gRPC client.
|
|
24
30
|
*
|
|
31
|
+
* @param configOrAddress The configuration object or the Milvus address as a string.
|
|
32
|
+
* @param ssl Whether to use SSL or not. Default is false.
|
|
33
|
+
* @param username The username for authentication. Required if password is provided.
|
|
34
|
+
* @param password The password for authentication. Required if username is provided.
|
|
25
35
|
*/
|
|
26
|
-
function BaseClient(
|
|
36
|
+
function BaseClient(configOrAddress, ssl, username, password, channelOptions) {
|
|
37
|
+
var config;
|
|
38
|
+
// If a configuration object is provided, use it. Otherwise, create a new object with the provided parameters.
|
|
39
|
+
if (typeof configOrAddress === 'object') {
|
|
40
|
+
config = configOrAddress;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
config = {
|
|
44
|
+
address: configOrAddress,
|
|
45
|
+
ssl: ssl,
|
|
46
|
+
username: username,
|
|
47
|
+
password: password,
|
|
48
|
+
channelOptions: channelOptions,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
27
51
|
// check if address is set
|
|
28
|
-
if (!address) {
|
|
52
|
+
if (!config.address) {
|
|
29
53
|
throw new Error(_1.ERROR_REASONS.MILVUS_ADDRESS_IS_REQUIRED);
|
|
30
54
|
}
|
|
31
55
|
// if we need to create auth interceptors
|
|
32
|
-
var needAuth = username !== undefined && password !== undefined;
|
|
56
|
+
var needAuth = config.username !== undefined && config.password !== undefined;
|
|
33
57
|
// get Milvus GRPC service
|
|
34
58
|
var MilvusService = (0, utils_1.getGRPCService)({
|
|
35
59
|
protoPath: protoPath,
|
|
@@ -37,20 +61,25 @@ var BaseClient = /** @class */ (function () {
|
|
|
37
61
|
});
|
|
38
62
|
// create interceptors
|
|
39
63
|
var interceptors = needAuth
|
|
40
|
-
? (0, utils_1.getAuthInterceptor)(username, password)
|
|
64
|
+
? (0, utils_1.getAuthInterceptor)(config.username, config.password)
|
|
41
65
|
: null;
|
|
42
66
|
// load proto
|
|
43
67
|
this.schemaProto = protobufjs_1.default.loadSync(schemaProtoPath);
|
|
44
68
|
this.milvusProto = protobufjs_1.default.loadSync(protoPath);
|
|
45
|
-
//
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
// setup timeout
|
|
70
|
+
this.timeout =
|
|
71
|
+
typeof config.timeout === 'string'
|
|
72
|
+
? (0, utils_1.parseTimeToken)(config.timeout)
|
|
73
|
+
: config.timeout || _1.DEFAULT_CONNECT_TIMEOUT;
|
|
74
|
+
// options
|
|
75
|
+
var options = __assign({ interceptors: [interceptors],
|
|
50
76
|
// Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
|
|
51
77
|
// So SDK should support max_receive_message_length unlimited.
|
|
52
|
-
'grpc.max_receive_message_length': -1,
|
|
53
|
-
|
|
78
|
+
'grpc.max_receive_message_length': -1 }, config.channelOptions);
|
|
79
|
+
// create grpc client
|
|
80
|
+
this.grpcClient = new MilvusService((0, utils_1.formatAddress)(config.address), // format the address
|
|
81
|
+
ssl ? grpc_js_1.credentials.createSsl() : grpc_js_1.credentials.createInsecure(), // create SSL or insecure credentials
|
|
82
|
+
options);
|
|
54
83
|
}
|
|
55
84
|
return BaseClient;
|
|
56
85
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../milvus/BaseClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../milvus/BaseClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,0DAA4C;AAC5C,yCAAoE;AACpE,sBAA+E;AAC/E,kCAKkB;AAElB,OAAO;AACP,IAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AACzE,IAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AAE/E,cAAc;AACd;IAUE;;;;;;;OAOG;IACH,oBACE,eAA4C,EAC5C,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QAE/B,IAAI,MAA0B,CAAC;QAE/B,8GAA8G;QAC9G,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE;YACvC,MAAM,GAAG,eAAe,CAAC;SAC1B;aAAM;YACL,MAAM,GAAG;gBACP,OAAO,EAAE,eAAe;gBACxB,GAAG,KAAA;gBACH,QAAQ,UAAA;gBACR,QAAQ,UAAA;gBACR,cAAc,gBAAA;aACf,CAAC;SACH;QAED,0BAA0B;QAC1B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,gBAAa,CAAC,0BAA0B,CAAC,CAAC;SAC3D;QAED,yCAAyC;QACzC,IAAM,QAAQ,GACZ,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC;QAEjE,0BAA0B;QAC1B,IAAM,aAAa,GAAG,IAAA,sBAAc,EAAC;YACnC,SAAS,WAAA;YACT,WAAW,EAAE,mCAAmC,EAAE,iCAAiC;SACpF,CAAC,CAAC;QAEH,sBAAsB;QACtB,IAAM,YAAY,GAAG,QAAQ;YAC3B,CAAC,CAAC,IAAA,0BAAkB,EAAC,MAAM,CAAC,QAAS,EAAE,MAAM,CAAC,QAAS,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC;QAET,aAAa;QACb,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEhD,gBAAgB;QAChB,IAAI,CAAC,OAAO;YACV,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;gBAChC,CAAC,CAAC,IAAA,sBAAc,EAAC,MAAM,CAAC,OAAO,CAAC;gBAChC,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,0BAAuB,CAAC;QAEhD,UAAU;QACV,IAAM,OAAO,cACX,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,6GAA6G;YAC7G,8DAA8D;YAC9D,iCAAiC,EAAE,CAAC,CAAC,IAClC,MAAM,CAAC,cAAc,CACzB,CAAC;QAEF,qBAAqB;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,aAAa,CACjC,IAAA,qBAAa,EAAC,MAAM,CAAC,OAAO,CAAC,EAAE,qBAAqB;QACpD,GAAG,CAAC,CAAC,CAAC,qBAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,qBAAW,CAAC,cAAc,EAAE,EAAE,qCAAqC;QACnG,OAAO,CACR,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAtFD,IAsFC;AAtFY,gCAAU"}
|
|
@@ -474,56 +474,56 @@ export declare class Collection extends BaseClient {
|
|
|
474
474
|
*/
|
|
475
475
|
getReplicas(data: GetReplicaReq): Promise<ReplicasResponse>;
|
|
476
476
|
/**
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
477
|
+
* Get loading progress of a collection
|
|
478
|
+
*
|
|
479
|
+
* @param data
|
|
480
|
+
* | Property | Type | Description |
|
|
481
|
+
* | :-- | :-- | :-- |
|
|
482
|
+
* | collection_name | string | the name of the collection |
|
|
483
|
+
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
|
|
484
|
+
*
|
|
485
|
+
* @returns
|
|
486
|
+
* | Property | Description |
|
|
487
|
+
* | :-- | :-- |
|
|
488
|
+
* | status | { error_code: number, reason: string } |
|
|
489
|
+
* | total_row_num | the total number of rows in the collection |
|
|
490
|
+
* | total_loaded_row_num | the total number of loaded rows in the collection |
|
|
491
|
+
*
|
|
492
|
+
* @throws {Error} if `collection_name` property is not present in `data`
|
|
493
|
+
*
|
|
494
|
+
* #### Example
|
|
495
|
+
*
|
|
496
|
+
* ```
|
|
497
|
+
* new milvusClient(MILUVS_ADDRESS).getLoadingProgress({
|
|
498
|
+
* collection_name: 'my_collection',
|
|
499
|
+
* });
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
502
|
getLoadingProgress(data: GetLoadingProgressReq): Promise<GetLoadingProgressResponse>;
|
|
503
503
|
/**
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
504
|
+
* Get the loading state of a collection
|
|
505
|
+
*
|
|
506
|
+
* @param data
|
|
507
|
+
* | Property | Type | Description |
|
|
508
|
+
* | :-- | :-- | :-- |
|
|
509
|
+
* | collection_name | string | the name of the collection |
|
|
510
|
+
* | timeout? | number | An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined |
|
|
511
|
+
*
|
|
512
|
+
* @returns
|
|
513
|
+
* | Property | Description |
|
|
514
|
+
* | :-- | :-- |
|
|
515
|
+
* | status | { error_code: number, reason: string } |
|
|
516
|
+
* | state | the loading state of the collection |
|
|
517
|
+
*
|
|
518
|
+
* @throws {Error} if `collection_name` property is not present in `data`
|
|
519
|
+
*
|
|
520
|
+
* #### Example
|
|
521
|
+
*
|
|
522
|
+
* ```
|
|
523
|
+
* new milvusClient(MILUVS_ADDRESS).getLoadState({
|
|
524
|
+
* collection_name: 'my_collection',
|
|
525
|
+
* });
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
528
528
|
getLoadState(data: GetLoadStateReq): Promise<GetLoadStateResponse>;
|
|
529
529
|
}
|