@zilliz/milvus2-sdk-node 2.1.3 → 2.2.0-alpha.1
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 +29 -40
- package/dist/milvus/Collection.d.ts +44 -2
- package/dist/milvus/Collection.js +80 -19
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +61 -8
- package/dist/milvus/Data.js +142 -44
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/MilvusIndex.js +6 -6
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.js +8 -8
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/User.js +7 -7
- package/dist/milvus/User.js.map +1 -1
- package/dist/milvus/const/ErrorReason.d.ts +4 -1
- package/dist/milvus/const/ErrorReason.js +3 -0
- package/dist/milvus/const/ErrorReason.js.map +1 -1
- package/dist/milvus/index.d.ts +3 -1
- package/dist/milvus/index.js +32 -4
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +8 -0
- package/dist/milvus/types/Common.d.ts +9 -1
- package/dist/milvus/types/Common.js +10 -1
- package/dist/milvus/types/Common.js.map +1 -1
- package/dist/milvus/types/Data.d.ts +15 -1
- package/dist/milvus/types/Response.d.ts +45 -1
- package/dist/milvus/types/Response.js.map +1 -1
- package/dist/milvus/types/Search.d.ts +3 -0
- package/dist/milvus/types.js +5 -1
- package/dist/milvus/types.js.map +1 -1
- package/dist/milvus/utils/Format.js +14 -10
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/index.d.ts +1 -1
- package/dist/proto/proto/common.proto +39 -24
- package/dist/proto/proto/google/protobuf/descriptor.proto +0 -14
- package/dist/proto/proto/milvus.proto +104 -56
- package/dist/proto/proto/schema.proto +10 -2
- package/dist/sdk.json +1 -1
- package/dist/utils/index.js +9 -5
- package/dist/utils/index.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
# Milvus2-sdk-node
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Node.js sdk for [Milvus](https://github.com/milvus-io/milvus).
|
|
9
9
|
|
|
10
10
|
## Compatibility
|
|
11
11
|
|
|
@@ -15,56 +15,41 @@ The following collection shows Milvus versions and recommended @zilliz/milvus2-s
|
|
|
15
15
|
| :------------: | :------------------------------------------: |
|
|
16
16
|
| 2.0.0 | 2.0.0 |
|
|
17
17
|
| 2.0.1 | 2.0.0, 2.0.1 |
|
|
18
|
+
| 2.1.x | 2.1.x |
|
|
19
|
+
| 2.2.x | 2.2.x |
|
|
18
20
|
|
|
19
21
|
## Dependencies
|
|
20
22
|
|
|
21
|
-
Milvus: v2+
|
|
22
|
-
|
|
23
|
-
Node: v12+
|
|
23
|
+
- Milvus: v2+
|
|
24
|
+
- Node: v12+
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
27
28
|
```javascript
|
|
28
|
-
|
|
29
|
+
npm install @zilliz/milvus2-sdk-node
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| dropCollection | false | Drop collection from milvus |
|
|
43
|
-
| createPartition | false | Create partition in one collection |
|
|
44
|
-
| hasPartition | false | Check partition exist or not |
|
|
45
|
-
| showPartitions | false | List all partitions for one collection |
|
|
46
|
-
| getPartitionStatistics | false | Get partition statistics like row_count |
|
|
47
|
-
| loadPartitions | true | Load data into cache |
|
|
48
|
-
| releasePartitions | true | Release data from cache |
|
|
49
|
-
| dropPartition | false | Drop partition from milvus |
|
|
50
|
-
| createIndex | true | Creat index on vector field |
|
|
51
|
-
| describeIndex | false | Get index info |
|
|
52
|
-
| getIndexState | false | Get index build state |
|
|
53
|
-
| getIndexBuildProgress | false | Get index building progress |
|
|
54
|
-
| dropIndex | true | Drop index |
|
|
55
|
-
| insert | false | Insert data into milvus |
|
|
56
|
-
| search | false | Vector similarity search |
|
|
57
|
-
| flush | true | Flush Data |
|
|
58
|
-
| flushSync | false | Flush Data Sync |
|
|
59
|
-
| query | false | Get data by expr |
|
|
60
|
-
| compact | true | Do compaction for the collection |
|
|
61
|
-
| getCompactionState | true | Get compaction states by compact id |
|
|
32
|
+
## SDK
|
|
33
|
+
|
|
34
|
+
- [Client](./milvus/Index.ts)
|
|
35
|
+
- [Collection](./milvus/Collection.ts)
|
|
36
|
+
- [Index](./milvus/MilvusIndex.ts)
|
|
37
|
+
- [Partition](./milvus/Partition.ts)
|
|
38
|
+
- [User](./milvus/User.ts)
|
|
39
|
+
- [Utils](./milvus/Utils.ts)
|
|
40
|
+
- [Data](./milvus/Data.ts)
|
|
41
|
+
|
|
42
|
+
More documentation, you can refer [Milvus offical website](https://milvus.io/).
|
|
62
43
|
|
|
63
44
|
## How to dev
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
|
|
46
|
+
1. yarn install
|
|
47
|
+
2. Fetch milvus proto
|
|
48
|
+
1. `git submodule init` (if this is your first time)
|
|
49
|
+
2. `git submodule update --remote`
|
|
50
|
+
3. Add feature in milvus folder.
|
|
51
|
+
4. Run test `yarn test -- test/Your-test-for-your-feature.spec.ts`
|
|
52
|
+
|
|
68
53
|
## Example
|
|
69
54
|
|
|
70
55
|
1. [Hello World](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/HelloMilvus.ts)
|
|
@@ -72,3 +57,7 @@ Node: v12+
|
|
|
72
57
|
3. [How to insert data](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Insert.ts)
|
|
73
58
|
4. [Vector similarity search on float field](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Search.ts)
|
|
74
59
|
5. [Vector similarity search on binary field](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/BinarySearch.ts)
|
|
60
|
+
|
|
61
|
+
## Others
|
|
62
|
+
|
|
63
|
+
[Attu](https://github.com/zilliztech/attu) which is a Milvus web interface tool, depends on Milvus node.js SDK.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq } from './types/Collection';
|
|
2
|
-
import { BoolResponse, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ResStatus, ShowCollectionsResponse, StatisticsResponse } from './types/Response';
|
|
1
|
+
import { CreateCollectionReq, DescribeCollectionReq, DropCollectionReq, GetCollectionStatisticsReq, LoadCollectionReq, ReleaseLoadCollectionReq, ShowCollectionsReq, HasCollectionReq, CreateAliasReq, DropAliasReq, AlterAliasReq, CompactReq, GetCompactionStateReq, GetCompactionPlansReq, GetReplicaReq } from './types/Collection';
|
|
2
|
+
import { BoolResponse, CompactionResponse, DescribeCollectionResponse, GetCompactionPlansResponse, GetCompactionStateResponse, ResStatus, ShowCollectionsResponse, StatisticsResponse, ReplicasResponse } from './types/Response';
|
|
3
3
|
import { Client } from './Client';
|
|
4
4
|
/**
|
|
5
5
|
* See all [collection operation examples](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts).
|
|
@@ -158,6 +158,7 @@ export declare class Collection extends Client {
|
|
|
158
158
|
* | Property | Type | Description |
|
|
159
159
|
* | :----------------- | :---- | :------------------------------- |
|
|
160
160
|
* | collection_name | String | Collection name |
|
|
161
|
+
* | replica_number? | number | Collection name |
|
|
161
162
|
* | 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 |
|
|
162
163
|
*
|
|
163
164
|
* @return
|
|
@@ -337,4 +338,45 @@ export declare class Collection extends Client {
|
|
|
337
338
|
* ```
|
|
338
339
|
*/
|
|
339
340
|
getCompactionStateWithPlans(data: GetCompactionPlansReq): Promise<GetCompactionPlansResponse>;
|
|
341
|
+
/**
|
|
342
|
+
* Get replicas
|
|
343
|
+
*
|
|
344
|
+
* @param data
|
|
345
|
+
* | Property | Type | Description |
|
|
346
|
+
* | :----------------- | :---- | :------------------------------- |
|
|
347
|
+
* | collectionID | number or string | the id returned by compact |
|
|
348
|
+
* | 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 |
|
|
349
|
+
*
|
|
350
|
+
* @return
|
|
351
|
+
* | Property | Description |
|
|
352
|
+
* | :-------------| :-------- |
|
|
353
|
+
* | status | { error_code: number, reason: string }|
|
|
354
|
+
* | ReplicaInfo[] | replica info array |
|
|
355
|
+
*
|
|
356
|
+
* #### Example
|
|
357
|
+
*
|
|
358
|
+
* ```
|
|
359
|
+
* new milvusClient(MILUVS_ADDRESS).collectionManager.getReplicas({
|
|
360
|
+
* collectionID: collectionID,
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* ```
|
|
364
|
+
*
|
|
365
|
+
* Return
|
|
366
|
+
* ```
|
|
367
|
+
* {
|
|
368
|
+
* replicas: [
|
|
369
|
+
* {
|
|
370
|
+
* partition_ids: [Array],
|
|
371
|
+
* shard_replicas: [Array],
|
|
372
|
+
* node_ids: [Array],
|
|
373
|
+
* replicaID: '436724291187770258',
|
|
374
|
+
* collectionID: '436777253933154305'
|
|
375
|
+
* }
|
|
376
|
+
* ],
|
|
377
|
+
* status: { error_code: 'Success', reason: '' }
|
|
378
|
+
* }
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
getReplicas(data: GetReplicaReq): Promise<ReplicasResponse>;
|
|
340
382
|
}
|
|
@@ -137,7 +137,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
137
137
|
if (!fields || !fields.length || !collection_name) {
|
|
138
138
|
throw new Error(ErrorReason_1.ERROR_REASONS.CREATE_COLLECTION_CHECK_PARAMS);
|
|
139
139
|
}
|
|
140
|
-
Validate_1.checkCollectionFields(fields);
|
|
140
|
+
(0, Validate_1.checkCollectionFields)(fields);
|
|
141
141
|
return [4 /*yield*/, protobufjs_1.default.load(schemaPath)];
|
|
142
142
|
case 1:
|
|
143
143
|
root = _c.sent();
|
|
@@ -149,7 +149,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
149
149
|
fields: [],
|
|
150
150
|
};
|
|
151
151
|
data.fields.forEach(function (field) {
|
|
152
|
-
var value = __assign(__assign({}, field), { typeParams: Format_1.parseToKeyValue(field.type_params), dataType: field.data_type, isPrimaryKey: field.is_primary_key });
|
|
152
|
+
var value = __assign(__assign({}, field), { typeParams: (0, Format_1.parseToKeyValue)(field.type_params), dataType: field.data_type, isPrimaryKey: field.is_primary_key });
|
|
153
153
|
var fieldParams = FieldSchema.create(value);
|
|
154
154
|
payload.fields.push(fieldParams);
|
|
155
155
|
});
|
|
@@ -158,7 +158,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
158
158
|
level = Object.keys(Collection_1.ConsistencyLevelEnum).includes(consistency_level)
|
|
159
159
|
? Collection_1.ConsistencyLevelEnum[consistency_level]
|
|
160
160
|
: Collection_1.ConsistencyLevelEnum['Bounded'];
|
|
161
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'CreateCollection', __assign(__assign({}, data), { schema: schemaBtyes, consistency_level: level }), data.timeout)];
|
|
161
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateCollection', __assign(__assign({}, data), { schema: schemaBtyes, consistency_level: level }), data.timeout)];
|
|
162
162
|
case 2:
|
|
163
163
|
promise = _c.sent();
|
|
164
164
|
return [2 /*return*/, promise];
|
|
@@ -197,7 +197,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
197
197
|
switch (_a.label) {
|
|
198
198
|
case 0:
|
|
199
199
|
this.checkCollectionName(data);
|
|
200
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'HasCollection', data, data.timeout)];
|
|
200
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'HasCollection', data, data.timeout)];
|
|
201
201
|
case 1:
|
|
202
202
|
promise = _a.sent();
|
|
203
203
|
return [2 /*return*/, promise];
|
|
@@ -233,7 +233,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
233
233
|
var promise, result;
|
|
234
234
|
return __generator(this, function (_a) {
|
|
235
235
|
switch (_a.label) {
|
|
236
|
-
case 0: return [4 /*yield*/, utils_1.promisify(this.client, 'ShowCollections', {
|
|
236
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ShowCollections', {
|
|
237
237
|
type: data ? data.type : Collection_1.ShowCollectionsType.All,
|
|
238
238
|
collection_names: (data === null || data === void 0 ? void 0 : data.collection_names) || [],
|
|
239
239
|
}, data === null || data === void 0 ? void 0 : data.timeout)];
|
|
@@ -286,7 +286,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
286
286
|
switch (_a.label) {
|
|
287
287
|
case 0:
|
|
288
288
|
this.checkCollectionName(data);
|
|
289
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'DescribeCollection', data, data.timeout)];
|
|
289
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DescribeCollection', data, data.timeout)];
|
|
290
290
|
case 1:
|
|
291
291
|
promise = _a.sent();
|
|
292
292
|
return [2 /*return*/, promise];
|
|
@@ -326,10 +326,10 @@ var Collection = /** @class */ (function (_super) {
|
|
|
326
326
|
switch (_a.label) {
|
|
327
327
|
case 0:
|
|
328
328
|
this.checkCollectionName(data);
|
|
329
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetCollectionStatistics', data, data.timeout)];
|
|
329
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCollectionStatistics', data, data.timeout)];
|
|
330
330
|
case 1:
|
|
331
331
|
promise = _a.sent();
|
|
332
|
-
promise.data = Format_1.formatKeyValueData(promise.stats, ['row_count']);
|
|
332
|
+
promise.data = (0, Format_1.formatKeyValueData)(promise.stats, ['row_count']);
|
|
333
333
|
return [2 /*return*/, promise];
|
|
334
334
|
}
|
|
335
335
|
});
|
|
@@ -343,6 +343,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
343
343
|
* | Property | Type | Description |
|
|
344
344
|
* | :----------------- | :---- | :------------------------------- |
|
|
345
345
|
* | collection_name | String | Collection name |
|
|
346
|
+
* | replica_number? | number | Collection name |
|
|
346
347
|
* | 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 |
|
|
347
348
|
*
|
|
348
349
|
* @return
|
|
@@ -366,7 +367,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
366
367
|
switch (_a.label) {
|
|
367
368
|
case 0:
|
|
368
369
|
this.checkCollectionName(data);
|
|
369
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'LoadCollection', data, data.timeout)];
|
|
370
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadCollection', data, data.timeout)];
|
|
370
371
|
case 1:
|
|
371
372
|
promise = _a.sent();
|
|
372
373
|
return [2 /*return*/, promise];
|
|
@@ -405,9 +406,12 @@ var Collection = /** @class */ (function (_super) {
|
|
|
405
406
|
switch (_a.label) {
|
|
406
407
|
case 0:
|
|
407
408
|
this.checkCollectionName(data);
|
|
408
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'LoadCollection', data, data.timeout)];
|
|
409
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadCollection', data, data.timeout)];
|
|
409
410
|
case 1:
|
|
410
411
|
promise = _a.sent();
|
|
412
|
+
if (promise.error_code !== Response_1.ErrorCode.SUCCESS) {
|
|
413
|
+
throw new Error("ErrorCode: ".concat(promise.error_code, ". Reason: ").concat(promise.reason));
|
|
414
|
+
}
|
|
411
415
|
loadedPercentage = 0;
|
|
412
416
|
_a.label = 2;
|
|
413
417
|
case 2:
|
|
@@ -419,7 +423,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
419
423
|
case 3:
|
|
420
424
|
res = _a.sent();
|
|
421
425
|
if (res.status.error_code !== Response_1.ErrorCode.SUCCESS) {
|
|
422
|
-
throw new Error("ErrorCode: "
|
|
426
|
+
throw new Error("ErrorCode: ".concat(res.status.error_code, ". Reason: ").concat(res.status.reason));
|
|
423
427
|
}
|
|
424
428
|
// Because we pass collection_names in showCollections, so it will only this collection in result.
|
|
425
429
|
loadedPercentage = Number(res.data[0].loadedPercentage);
|
|
@@ -460,7 +464,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
460
464
|
switch (_a.label) {
|
|
461
465
|
case 0:
|
|
462
466
|
this.checkCollectionName(data);
|
|
463
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'ReleaseCollection', data, data.timeout)];
|
|
467
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ReleaseCollection', data, data.timeout)];
|
|
464
468
|
case 1:
|
|
465
469
|
promise = _a.sent();
|
|
466
470
|
return [2 /*return*/, promise];
|
|
@@ -498,7 +502,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
498
502
|
switch (_a.label) {
|
|
499
503
|
case 0:
|
|
500
504
|
this.checkCollectionName(data);
|
|
501
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'DropCollection', data, data.timeout)];
|
|
505
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropCollection', data, data.timeout)];
|
|
502
506
|
case 1:
|
|
503
507
|
promise = _a.sent();
|
|
504
508
|
return [2 /*return*/, promise];
|
|
@@ -521,7 +525,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
521
525
|
if (!data.alias) {
|
|
522
526
|
throw new Error(ErrorReason_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
523
527
|
}
|
|
524
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'CreateAlias', data, data.timeout)];
|
|
528
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateAlias', data, data.timeout)];
|
|
525
529
|
case 1:
|
|
526
530
|
promise = _a.sent();
|
|
527
531
|
return [2 /*return*/, promise];
|
|
@@ -542,7 +546,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
542
546
|
if (!data.alias) {
|
|
543
547
|
throw new Error(ErrorReason_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
544
548
|
}
|
|
545
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'DropAlias', data, data.timeout)];
|
|
549
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropAlias', data, data.timeout)];
|
|
546
550
|
case 1:
|
|
547
551
|
promise = _a.sent();
|
|
548
552
|
return [2 /*return*/, promise];
|
|
@@ -564,7 +568,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
564
568
|
if (!data.alias) {
|
|
565
569
|
throw new Error(ErrorReason_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
566
570
|
}
|
|
567
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'AlterAlias', data, data.timeout)];
|
|
571
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'AlterAlias', data, data.timeout)];
|
|
568
572
|
case 1:
|
|
569
573
|
promise = _a.sent();
|
|
570
574
|
return [2 /*return*/, promise];
|
|
@@ -605,7 +609,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
605
609
|
return [4 /*yield*/, this.describeCollection(data)];
|
|
606
610
|
case 1:
|
|
607
611
|
collectionInfo = _a.sent();
|
|
608
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'ManualCompaction', {
|
|
612
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ManualCompaction', {
|
|
609
613
|
collectionID: collectionInfo.collectionID,
|
|
610
614
|
}, data.timeout)];
|
|
611
615
|
case 2:
|
|
@@ -647,7 +651,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
647
651
|
if (!data || !data.compactionID) {
|
|
648
652
|
throw new Error(ErrorReason_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
649
653
|
}
|
|
650
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetCompactionState', data, data.timeout)];
|
|
654
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCompactionState', data, data.timeout)];
|
|
651
655
|
case 1:
|
|
652
656
|
res = _a.sent();
|
|
653
657
|
return [2 /*return*/, res];
|
|
@@ -687,7 +691,64 @@ var Collection = /** @class */ (function (_super) {
|
|
|
687
691
|
if (!data || !data.compactionID) {
|
|
688
692
|
throw new Error(ErrorReason_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
689
693
|
}
|
|
690
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetCompactionStateWithPlans', data, data.timeout)];
|
|
694
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCompactionStateWithPlans', data, data.timeout)];
|
|
695
|
+
case 1:
|
|
696
|
+
res = _a.sent();
|
|
697
|
+
return [2 /*return*/, res];
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
/**
|
|
703
|
+
* Get replicas
|
|
704
|
+
*
|
|
705
|
+
* @param data
|
|
706
|
+
* | Property | Type | Description |
|
|
707
|
+
* | :----------------- | :---- | :------------------------------- |
|
|
708
|
+
* | collectionID | number or string | the id returned by compact |
|
|
709
|
+
* | 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 |
|
|
710
|
+
*
|
|
711
|
+
* @return
|
|
712
|
+
* | Property | Description |
|
|
713
|
+
* | :-------------| :-------- |
|
|
714
|
+
* | status | { error_code: number, reason: string }|
|
|
715
|
+
* | ReplicaInfo[] | replica info array |
|
|
716
|
+
*
|
|
717
|
+
* #### Example
|
|
718
|
+
*
|
|
719
|
+
* ```
|
|
720
|
+
* new milvusClient(MILUVS_ADDRESS).collectionManager.getReplicas({
|
|
721
|
+
* collectionID: collectionID,
|
|
722
|
+
* });
|
|
723
|
+
*
|
|
724
|
+
* ```
|
|
725
|
+
*
|
|
726
|
+
* Return
|
|
727
|
+
* ```
|
|
728
|
+
* {
|
|
729
|
+
* replicas: [
|
|
730
|
+
* {
|
|
731
|
+
* partition_ids: [Array],
|
|
732
|
+
* shard_replicas: [Array],
|
|
733
|
+
* node_ids: [Array],
|
|
734
|
+
* replicaID: '436724291187770258',
|
|
735
|
+
* collectionID: '436777253933154305'
|
|
736
|
+
* }
|
|
737
|
+
* ],
|
|
738
|
+
* status: { error_code: 'Success', reason: '' }
|
|
739
|
+
* }
|
|
740
|
+
* ```
|
|
741
|
+
*/
|
|
742
|
+
Collection.prototype.getReplicas = function (data) {
|
|
743
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
744
|
+
var res;
|
|
745
|
+
return __generator(this, function (_a) {
|
|
746
|
+
switch (_a.label) {
|
|
747
|
+
case 0:
|
|
748
|
+
if (!data || !data.collectionID) {
|
|
749
|
+
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_ID_IS_REQUIRED);
|
|
750
|
+
}
|
|
751
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetReplicas', data, data.timeout)];
|
|
691
752
|
case 1:
|
|
692
753
|
res = _a.sent();
|
|
693
754
|
return [2 /*return*/, res];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../milvus/Collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAkC;AAClC,kCAAqC;AACrC,mDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../milvus/Collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,AAroBD,CAAgC,eAAM,GAqoBrC;AAroBY,gCAAU"}
|
package/dist/milvus/Data.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from './Client';
|
|
2
2
|
import { Collection } from './Collection';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, InsertReq, LoadBalanceReq, ImportReq, ListImportTasksReq } from './types/Data';
|
|
4
|
+
import { FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults, ImportResponse, ListImportTasksResponse } from './types/Response';
|
|
5
5
|
import { GetMetricsRequest, QueryReq, SearchReq } from './types/Search';
|
|
6
6
|
export declare class Data extends Client {
|
|
7
7
|
vectorTypes: number[];
|
|
@@ -170,7 +170,7 @@ export declare class Data extends Client {
|
|
|
170
170
|
* | partitions_names(optional) | String[] | Array of partition names |
|
|
171
171
|
* | output_fields | String[] | Vector or scalar field to be returned |
|
|
172
172
|
* | 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 |
|
|
173
|
-
*
|
|
173
|
+
* | params | {key: value}[] | An optional key pair json array
|
|
174
174
|
*
|
|
175
175
|
* @return
|
|
176
176
|
* | Property | Description |
|
|
@@ -198,11 +198,6 @@ export declare class Data extends Client {
|
|
|
198
198
|
* | request | object | Only allow "system_info" for now |
|
|
199
199
|
*/
|
|
200
200
|
getMetric(data: GetMetricsRequest): Promise<GetMetricsResponse>;
|
|
201
|
-
/**
|
|
202
|
-
* @ignore
|
|
203
|
-
* @param data
|
|
204
|
-
*/
|
|
205
|
-
calcDistance(data: CalcDistanceReq): Promise<CalcDistanceResponse>;
|
|
206
201
|
/**
|
|
207
202
|
* Get flush state by segment ids
|
|
208
203
|
*
|
|
@@ -283,4 +278,62 @@ export declare class Data extends Client {
|
|
|
283
278
|
* ```
|
|
284
279
|
*/
|
|
285
280
|
getQuerySegmentInfo(data: GetQuerySegmentInfoReq): Promise<GetQuerySegmentInfoResponse>;
|
|
281
|
+
/**
|
|
282
|
+
* Import data from files
|
|
283
|
+
*
|
|
284
|
+
* @param data
|
|
285
|
+
* | Property | Type | Description |
|
|
286
|
+
* | :---------------------- | :---- | :------------------------------- |
|
|
287
|
+
* | collection_name | String | The name of the collection |
|
|
288
|
+
* | files | string[] | File path array |
|
|
289
|
+
*
|
|
290
|
+
*
|
|
291
|
+
* @return
|
|
292
|
+
* | Property | Description |
|
|
293
|
+
* | :-----------| :------------------------------- |
|
|
294
|
+
* | status | { error_code: number,reason:string } |
|
|
295
|
+
* | tasks | taskId array |
|
|
296
|
+
*
|
|
297
|
+
*
|
|
298
|
+
* #### Example
|
|
299
|
+
*
|
|
300
|
+
* ```
|
|
301
|
+
* const res = await dataManager.bulkInsert({
|
|
302
|
+
* collection_name: COLLECTION,
|
|
303
|
+
* files: [`path-to-data-file.json`]
|
|
304
|
+
* });
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
bulkInsert(data: ImportReq): Promise<ImportResponse>;
|
|
308
|
+
/**
|
|
309
|
+
* List import tasks
|
|
310
|
+
*
|
|
311
|
+
* @param data
|
|
312
|
+
* | Property | Type | Description |
|
|
313
|
+
* | :---------------------- | :---- | :------------------------------- |
|
|
314
|
+
* | collection_name | String | The name of the collection |
|
|
315
|
+
* | limit | number | optional, maximum number of tasks returned, list all tasks if the value is 0 |
|
|
316
|
+
*
|
|
317
|
+
*
|
|
318
|
+
* @return
|
|
319
|
+
* | Property | Description |
|
|
320
|
+
* | :-----------| :------------------------------- |
|
|
321
|
+
* | status | { error_code: number,reason:string } |
|
|
322
|
+
* | state | import state |
|
|
323
|
+
* | row_count | how many rows to import|
|
|
324
|
+
* | id_list| id lists |
|
|
325
|
+
* | collection_id | collection to be imported to |
|
|
326
|
+
* |
|
|
327
|
+
* | tasks | taskId array |
|
|
328
|
+
*
|
|
329
|
+
*
|
|
330
|
+
* #### Example
|
|
331
|
+
*
|
|
332
|
+
* ```
|
|
333
|
+
* const res = await dataManager.listImportTasks({
|
|
334
|
+
* collection_name: COLLECTION
|
|
335
|
+
* });
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
listImportTasks(data: ListImportTasksReq): Promise<ListImportTasksResponse>;
|
|
286
339
|
}
|