@zilliz/milvus2-sdk-node 2.2.5 → 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 +54 -1
- package/dist/milvus/Collection.js +141 -40
- 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 +25 -19
- package/dist/milvus/const/Milvus.js +31 -31
- 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/Collection.d.ts +33 -16
- package/dist/milvus/types/Collection.js.map +1 -1
- 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 +29 -5
- package/dist/proto/proto/milvus.proto +24 -0
- package/dist/proto/proto/schema.proto +17 -1
- package/dist/sdk.json +1 -1
- package/dist/utils/Format.d.ts +28 -1
- package/dist/utils/Format.js +73 -7
- 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 +9 -8
- package/dist/utils/test.js +48 -18
- package/dist/utils/test.js.map +1 -1
- package/package.json +4 -4
|
@@ -61,11 +61,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
65
|
+
var t = {};
|
|
66
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
67
|
+
t[p] = s[p];
|
|
68
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
69
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
70
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
71
|
+
t[p[i]] = s[p[i]];
|
|
72
|
+
}
|
|
73
|
+
return t;
|
|
74
|
+
};
|
|
64
75
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
76
|
exports.Collection = void 0;
|
|
66
77
|
var utils_1 = require("../utils");
|
|
67
78
|
var BaseClient_1 = require("./BaseClient");
|
|
68
79
|
var _1 = require(".");
|
|
80
|
+
var utils_2 = require("../utils");
|
|
69
81
|
/**
|
|
70
82
|
* @see [collection operation examples](https://github.com/milvus-io/milvus-sdk-node/blob/main/example/Collection.ts)
|
|
71
83
|
*/
|
|
@@ -118,36 +130,37 @@ var Collection = /** @class */ (function (_super) {
|
|
|
118
130
|
* ```
|
|
119
131
|
*/
|
|
120
132
|
Collection.prototype.createCollection = function (data) {
|
|
133
|
+
var _a;
|
|
121
134
|
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
var
|
|
123
|
-
return __generator(this, function (
|
|
124
|
-
switch (
|
|
135
|
+
var _b, fields, collection_name, description, _c, consistency_level, CollectionSchema, FieldSchema, payload, collectionParams, schemaBytes, level, promise;
|
|
136
|
+
return __generator(this, function (_d) {
|
|
137
|
+
switch (_d.label) {
|
|
125
138
|
case 0:
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
_b = data || {}, fields = _b.fields, collection_name = _b.collection_name, description = _b.description, _c = _b.consistency_level, consistency_level = _c === void 0 ? 'Bounded' : _c;
|
|
140
|
+
// Check if fields and collection_name are present, otherwise throw an error.
|
|
141
|
+
if (!(fields === null || fields === void 0 ? void 0 : fields.length) || !collection_name) {
|
|
128
142
|
throw new Error(_1.ERROR_REASONS.CREATE_COLLECTION_CHECK_PARAMS);
|
|
129
143
|
}
|
|
144
|
+
// Check if the fields are valid.
|
|
130
145
|
(0, utils_1.checkCollectionFields)(fields);
|
|
131
146
|
CollectionSchema = this.schemaProto.lookupType('milvus.proto.schema.CollectionSchema');
|
|
132
147
|
FieldSchema = this.schemaProto.lookupType('milvus.proto.schema.FieldSchema');
|
|
133
148
|
payload = {
|
|
134
149
|
name: collection_name,
|
|
135
150
|
description: description || '',
|
|
136
|
-
fields:
|
|
151
|
+
fields: fields.map(function (field) {
|
|
152
|
+
// Assign the typeParams property to the result of parseToKeyValue(type_params).
|
|
153
|
+
var _a = (0, utils_2.assignTypeParams)(field), type_params = _a.type_params, rest = __rest(_a, ["type_params"]);
|
|
154
|
+
return FieldSchema.create(__assign(__assign({}, rest), { typeParams: (0, utils_1.parseToKeyValue)(type_params), dataType: field.data_type, isPrimaryKey: field.is_primary_key }));
|
|
155
|
+
}),
|
|
137
156
|
};
|
|
138
|
-
data.fields.forEach(function (field) {
|
|
139
|
-
var value = __assign(__assign({}, field), { typeParams: (0, utils_1.parseToKeyValue)(field.type_params), dataType: field.data_type, isPrimaryKey: field.is_primary_key });
|
|
140
|
-
var fieldParams = FieldSchema.create(value);
|
|
141
|
-
payload.fields.push(fieldParams);
|
|
142
|
-
});
|
|
143
157
|
collectionParams = CollectionSchema.create(payload);
|
|
144
|
-
|
|
145
|
-
level =
|
|
146
|
-
|
|
147
|
-
: _1.ConsistencyLevelEnum['Bounded'];
|
|
148
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CreateCollection', __assign(__assign({}, data), { schema: schemaBtyes, consistency_level: level }), data.timeout)];
|
|
158
|
+
schemaBytes = CollectionSchema.encode(collectionParams).finish();
|
|
159
|
+
level = (_a = _1.ConsistencyLevelEnum[consistency_level]) !== null && _a !== void 0 ? _a : _1.ConsistencyLevelEnum.Bounded;
|
|
160
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CreateCollection', __assign(__assign({}, data), { schema: schemaBytes, consistency_level: level }), data.timeout || this.timeout)];
|
|
149
161
|
case 1:
|
|
150
|
-
promise =
|
|
162
|
+
promise = _d.sent();
|
|
163
|
+
// Return the promise.
|
|
151
164
|
return [2 /*return*/, promise];
|
|
152
165
|
}
|
|
153
166
|
});
|
|
@@ -184,7 +197,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
184
197
|
switch (_a.label) {
|
|
185
198
|
case 0:
|
|
186
199
|
(0, utils_1.checkCollectionName)(data);
|
|
187
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'HasCollection', data, data.timeout)];
|
|
200
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'HasCollection', data, data.timeout || this.timeout)];
|
|
188
201
|
case 1:
|
|
189
202
|
promise = _a.sent();
|
|
190
203
|
return [2 /*return*/, promise];
|
|
@@ -224,7 +237,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
224
237
|
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ShowCollections', {
|
|
225
238
|
type: data ? data.type : _1.ShowCollectionsType.All,
|
|
226
239
|
collection_names: (data === null || data === void 0 ? void 0 : data.collection_names) || [],
|
|
227
|
-
}, data === null || data === void 0 ? void 0 : data.timeout)];
|
|
240
|
+
}, (data === null || data === void 0 ? void 0 : data.timeout) || this.timeout)];
|
|
228
241
|
case 1:
|
|
229
242
|
promise = _a.sent();
|
|
230
243
|
result = [];
|
|
@@ -274,7 +287,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
274
287
|
switch (_a.label) {
|
|
275
288
|
case 0:
|
|
276
289
|
(0, utils_1.checkCollectionName)(data);
|
|
277
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DescribeCollection', data, data.timeout)];
|
|
290
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DescribeCollection', data, data.timeout || this.timeout)];
|
|
278
291
|
case 1:
|
|
279
292
|
promise = _a.sent();
|
|
280
293
|
return [2 /*return*/, promise];
|
|
@@ -314,7 +327,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
314
327
|
switch (_a.label) {
|
|
315
328
|
case 0:
|
|
316
329
|
(0, utils_1.checkCollectionName)(data);
|
|
317
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCollectionStatistics', data, data.timeout)];
|
|
330
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCollectionStatistics', data, data.timeout || this.timeout)];
|
|
318
331
|
case 1:
|
|
319
332
|
promise = _a.sent();
|
|
320
333
|
promise.data = (0, utils_1.formatKeyValueData)(promise.stats, ['row_count']);
|
|
@@ -356,7 +369,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
356
369
|
switch (_a.label) {
|
|
357
370
|
case 0:
|
|
358
371
|
(0, utils_1.checkCollectionName)(data);
|
|
359
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadCollection', data, data.timeout)];
|
|
372
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadCollection', data, data.timeout || this.timeout)];
|
|
360
373
|
case 1:
|
|
361
374
|
promise = _a.sent();
|
|
362
375
|
return [2 /*return*/, promise];
|
|
@@ -397,7 +410,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
397
410
|
switch (_a.label) {
|
|
398
411
|
case 0:
|
|
399
412
|
(0, utils_1.checkCollectionName)(data);
|
|
400
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadCollection', data, data.timeout)];
|
|
413
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadCollection', data, data.timeout || this.timeout)];
|
|
401
414
|
case 1:
|
|
402
415
|
promise = _a.sent();
|
|
403
416
|
if (promise.error_code !== _1.ErrorCode.SUCCESS) {
|
|
@@ -406,20 +419,23 @@ var Collection = /** @class */ (function (_super) {
|
|
|
406
419
|
loadedPercentage = 0;
|
|
407
420
|
_a.label = 2;
|
|
408
421
|
case 2:
|
|
409
|
-
if (!(Number(loadedPercentage) < 100)) return [3 /*break*/,
|
|
410
|
-
return [4 /*yield*/, this.
|
|
411
|
-
|
|
412
|
-
type: _1.ShowCollectionsType.Loaded,
|
|
422
|
+
if (!(Number(loadedPercentage) < 100)) return [3 /*break*/, 5];
|
|
423
|
+
return [4 /*yield*/, this.getLoadingProgress({
|
|
424
|
+
collection_name: data.collection_name,
|
|
413
425
|
})];
|
|
414
426
|
case 3:
|
|
415
427
|
res = _a.sent();
|
|
416
428
|
if (res.status.error_code !== _1.ErrorCode.SUCCESS) {
|
|
417
429
|
throw new Error("ErrorCode: ".concat(res.status.error_code, ". Reason: ").concat(res.status.reason));
|
|
418
430
|
}
|
|
419
|
-
|
|
420
|
-
|
|
431
|
+
loadedPercentage = Number(res.progress);
|
|
432
|
+
// sleep 400ms
|
|
433
|
+
return [4 /*yield*/, (0, utils_1.sleep)(400)];
|
|
434
|
+
case 4:
|
|
435
|
+
// sleep 400ms
|
|
436
|
+
_a.sent();
|
|
421
437
|
return [3 /*break*/, 2];
|
|
422
|
-
case
|
|
438
|
+
case 5: return [2 /*return*/, promise];
|
|
423
439
|
}
|
|
424
440
|
});
|
|
425
441
|
});
|
|
@@ -455,7 +471,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
455
471
|
switch (_a.label) {
|
|
456
472
|
case 0:
|
|
457
473
|
(0, utils_1.checkCollectionName)(data);
|
|
458
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ReleaseCollection', data, data.timeout)];
|
|
474
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ReleaseCollection', data, data.timeout || this.timeout)];
|
|
459
475
|
case 1:
|
|
460
476
|
promise = _a.sent();
|
|
461
477
|
return [2 /*return*/, promise];
|
|
@@ -496,7 +512,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
496
512
|
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'RenameCollection', {
|
|
497
513
|
oldName: data.collection_name,
|
|
498
514
|
newName: data.new_collection_name,
|
|
499
|
-
}, data.timeout)];
|
|
515
|
+
}, data.timeout || this.timeout)];
|
|
500
516
|
case 1:
|
|
501
517
|
promise = _a.sent();
|
|
502
518
|
return [2 /*return*/, promise];
|
|
@@ -534,7 +550,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
534
550
|
switch (_a.label) {
|
|
535
551
|
case 0:
|
|
536
552
|
(0, utils_1.checkCollectionName)(data);
|
|
537
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DropCollection', data, data.timeout)];
|
|
553
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DropCollection', data, data.timeout || this.timeout)];
|
|
538
554
|
case 1:
|
|
539
555
|
promise = _a.sent();
|
|
540
556
|
return [2 /*return*/, promise];
|
|
@@ -578,7 +594,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
578
594
|
if (!data.alias) {
|
|
579
595
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
580
596
|
}
|
|
581
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CreateAlias', data, data.timeout)];
|
|
597
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CreateAlias', data, data.timeout || this.timeout)];
|
|
582
598
|
case 1:
|
|
583
599
|
promise = _a.sent();
|
|
584
600
|
return [2 /*return*/, promise];
|
|
@@ -621,7 +637,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
621
637
|
if (!data.alias) {
|
|
622
638
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
623
639
|
}
|
|
624
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DropAlias', data, data.timeout)];
|
|
640
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DropAlias', data, data.timeout || this.timeout)];
|
|
625
641
|
case 1:
|
|
626
642
|
promise = _a.sent();
|
|
627
643
|
return [2 /*return*/, promise];
|
|
@@ -665,7 +681,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
665
681
|
if (!data.alias) {
|
|
666
682
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
667
683
|
}
|
|
668
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'AlterAlias', data, data.timeout)];
|
|
684
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'AlterAlias', data, data.timeout || this.timeout)];
|
|
669
685
|
case 1:
|
|
670
686
|
promise = _a.sent();
|
|
671
687
|
return [2 /*return*/, promise];
|
|
@@ -708,7 +724,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
708
724
|
collectionInfo = _a.sent();
|
|
709
725
|
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ManualCompaction', {
|
|
710
726
|
collectionID: collectionInfo.collectionID,
|
|
711
|
-
}, data.timeout)];
|
|
727
|
+
}, data.timeout || this.timeout)];
|
|
712
728
|
case 2:
|
|
713
729
|
res = _a.sent();
|
|
714
730
|
return [2 /*return*/, res];
|
|
@@ -748,7 +764,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
748
764
|
if (!data || !data.compactionID) {
|
|
749
765
|
throw new Error(_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
750
766
|
}
|
|
751
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCompactionState', data, data.timeout)];
|
|
767
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCompactionState', data, data.timeout || this.timeout)];
|
|
752
768
|
case 1:
|
|
753
769
|
res = _a.sent();
|
|
754
770
|
return [2 /*return*/, res];
|
|
@@ -788,7 +804,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
788
804
|
if (!data || !data.compactionID) {
|
|
789
805
|
throw new Error(_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
790
806
|
}
|
|
791
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCompactionStateWithPlans', data, data.timeout)];
|
|
807
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetCompactionStateWithPlans', data, data.timeout || this.timeout)];
|
|
792
808
|
case 1:
|
|
793
809
|
res = _a.sent();
|
|
794
810
|
return [2 /*return*/, res];
|
|
@@ -845,7 +861,92 @@ var Collection = /** @class */ (function (_super) {
|
|
|
845
861
|
if (!data || !data.collectionID) {
|
|
846
862
|
throw new Error(_1.ERROR_REASONS.COLLECTION_ID_IS_REQUIRED);
|
|
847
863
|
}
|
|
848
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetReplicas', data, data.timeout)];
|
|
864
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetReplicas', data, data.timeout || this.timeout)];
|
|
865
|
+
case 1:
|
|
866
|
+
res = _a.sent();
|
|
867
|
+
return [2 /*return*/, res];
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
});
|
|
871
|
+
};
|
|
872
|
+
/**
|
|
873
|
+
* Get loading progress of a collection
|
|
874
|
+
*
|
|
875
|
+
* @param data
|
|
876
|
+
* | Property | Type | Description |
|
|
877
|
+
* | :-- | :-- | :-- |
|
|
878
|
+
* | collection_name | string | the name of the collection |
|
|
879
|
+
* | 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 |
|
|
880
|
+
*
|
|
881
|
+
* @returns
|
|
882
|
+
* | Property | Description |
|
|
883
|
+
* | :-- | :-- |
|
|
884
|
+
* | status | { error_code: number, reason: string } |
|
|
885
|
+
* | total_row_num | the total number of rows in the collection |
|
|
886
|
+
* | total_loaded_row_num | the total number of loaded rows in the collection |
|
|
887
|
+
*
|
|
888
|
+
* @throws {Error} if `collection_name` property is not present in `data`
|
|
889
|
+
*
|
|
890
|
+
* #### Example
|
|
891
|
+
*
|
|
892
|
+
* ```
|
|
893
|
+
* new milvusClient(MILUVS_ADDRESS).getLoadingProgress({
|
|
894
|
+
* collection_name: 'my_collection',
|
|
895
|
+
* });
|
|
896
|
+
* ```
|
|
897
|
+
*/
|
|
898
|
+
Collection.prototype.getLoadingProgress = function (data) {
|
|
899
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
900
|
+
var res;
|
|
901
|
+
return __generator(this, function (_a) {
|
|
902
|
+
switch (_a.label) {
|
|
903
|
+
case 0:
|
|
904
|
+
if (!data || !data.collection_name) {
|
|
905
|
+
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
906
|
+
}
|
|
907
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetLoadingProgress', data, data.timeout || this.timeout)];
|
|
908
|
+
case 1:
|
|
909
|
+
res = _a.sent();
|
|
910
|
+
return [2 /*return*/, res];
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
/**
|
|
916
|
+
* Get the loading state of a collection
|
|
917
|
+
*
|
|
918
|
+
* @param data
|
|
919
|
+
* | Property | Type | Description |
|
|
920
|
+
* | :-- | :-- | :-- |
|
|
921
|
+
* | collection_name | string | the name of the collection |
|
|
922
|
+
* | 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 |
|
|
923
|
+
*
|
|
924
|
+
* @returns
|
|
925
|
+
* | Property | Description |
|
|
926
|
+
* | :-- | :-- |
|
|
927
|
+
* | status | { error_code: number, reason: string } |
|
|
928
|
+
* | state | the loading state of the collection |
|
|
929
|
+
*
|
|
930
|
+
* @throws {Error} if `collection_name` property is not present in `data`
|
|
931
|
+
*
|
|
932
|
+
* #### Example
|
|
933
|
+
*
|
|
934
|
+
* ```
|
|
935
|
+
* new milvusClient(MILUVS_ADDRESS).getLoadState({
|
|
936
|
+
* collection_name: 'my_collection',
|
|
937
|
+
* });
|
|
938
|
+
* ```
|
|
939
|
+
*/
|
|
940
|
+
Collection.prototype.getLoadState = function (data) {
|
|
941
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
942
|
+
var res;
|
|
943
|
+
return __generator(this, function (_a) {
|
|
944
|
+
switch (_a.label) {
|
|
945
|
+
case 0:
|
|
946
|
+
if (!data || !data.collection_name) {
|
|
947
|
+
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
948
|
+
}
|
|
949
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetLoadState', data, data.timeout || this.timeout)];
|
|
849
950
|
case 1:
|
|
850
951
|
res = _a.sent();
|
|
851
952
|
return [2 /*return*/, res];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../milvus/Collection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../milvus/Collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAOkB;AAClB,2CAA0C;AAC1C,sBAmCW;AACX,kCAA4C;AAE5C;;GAEG;AACH;IAAgC,8BAAU;IAA1C;;IAi1BA,CAAC;IAh1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACG,qCAAgB,GAAtB,UAAuB,IAAyB;;;;;;;wBAExC,KAKF,IAAI,IAAI,EAAE,EAJZ,MAAM,YAAA,EACN,eAAe,qBAAA,EACf,WAAW,iBAAA,EACX,yBAA6B,EAA7B,iBAAiB,mBAAG,SAAS,KAAA,CAChB;wBAEf,6EAA6E;wBAC7E,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,CAAC,eAAe,EAAE;4BACvC,MAAM,IAAI,KAAK,CAAC,gBAAa,CAAC,8BAA8B,CAAC,CAAC;yBAC/D;wBAED,iCAAiC;wBACjC,IAAA,6BAAqB,EAAC,MAAM,CAAC,CAAC;wBAGxB,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAClD,sCAAsC,CACvC,CAAC;wBACI,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAC7C,iCAAiC,CAClC,CAAC;wBAGI,OAAO,GAAG;4BACd,IAAI,EAAE,eAAe;4BACrB,WAAW,EAAE,WAAW,IAAI,EAAE;4BAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK;gCACtB,gFAAgF;gCAChF,IAAM,KAA2B,IAAA,wBAAgB,EAAC,KAAK,CAAC,EAAhD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AC,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;4BAClC,MAAM,IAAI,KAAK,CAAC,gBAAa,CAAC,2BAA2B,CAAC,CAAC;yBAC5D;wBACW,qBAAM,IAAA,iBAAS,EACzB,IAAI,CAAC,UAAU,EACf,cAAc,EACd,IAAI,EACJ,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAC7B,EAAA;;wBALK,GAAG,GAAG,SAKX;wBACD,sBAAO,GAAG,EAAC;;;;KACZ;IACH,iBAAC;AAAD,CAAC,AAj1BD,CAAgC,uBAAU,GAi1BzC;AAj1BY,gCAAU"}
|
package/dist/milvus/Data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataType, DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, InsertReq, LoadBalanceReq, ImportReq, ListImportTasksReq, FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults, ImportResponse, ListImportTasksResponse, GetMetricsRequest, QueryReq, SearchReq } from '.';
|
|
1
|
+
import { DataType, DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, InsertReq, LoadBalanceReq, ImportReq, ListImportTasksReq, FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults, ImportResponse, ListImportTasksResponse, GetMetricsRequest, QueryReq, SearchReq, SearchSimpleReq } from '.';
|
|
2
2
|
import { Collection } from './Collection';
|
|
3
3
|
export declare class Data extends Collection {
|
|
4
4
|
vectorTypes: DataType[];
|
|
@@ -73,15 +73,14 @@ export declare class Data extends Collection {
|
|
|
73
73
|
* | Property | Type | Description |
|
|
74
74
|
* | :--- | :-- | :-- |
|
|
75
75
|
* | collection_name | String | Collection name |
|
|
76
|
+
* | vectors or vector | Number[][] or Number[] | Original vector to search with |
|
|
76
77
|
* | partition_names(optional)| String[] | Array of partition names |
|
|
77
|
-
* |
|
|
78
|
-
* |
|
|
79
|
-
* |
|
|
80
|
-
* | output_fields(optional) | String[] |
|
|
81
|
-
* |
|
|
82
|
-
* |
|
|
83
|
-
* | 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 |
|
|
84
|
-
|
|
78
|
+
* | limit(optional) | number | topk |
|
|
79
|
+
* | offset(optional) | number | offset |
|
|
80
|
+
* | filter(optional) | String | Scalar field filter expression |
|
|
81
|
+
* | output_fields(optional) | String[] | Support scalar field |
|
|
82
|
+
* | metric_type(optional) | String | similarity metric |
|
|
83
|
+
* | params(optional) | key value object | search params |
|
|
85
84
|
*
|
|
86
85
|
* @returns
|
|
87
86
|
* | Property | Description |
|
|
@@ -89,27 +88,16 @@ export declare class Data extends Collection {
|
|
|
89
88
|
* | status | { error_code: number, reason: string } |
|
|
90
89
|
* | results | {score:number,id:string}[]; |
|
|
91
90
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
91
|
* #### Example
|
|
95
92
|
*
|
|
96
93
|
* ```
|
|
97
94
|
* new milvusClient(MILUVS_ADDRESS).search({
|
|
98
95
|
* collection_name: COLLECTION_NAME,
|
|
99
|
-
*
|
|
100
|
-
* vectors: [[1, 2, 3, 4]],
|
|
101
|
-
* search_params: {
|
|
102
|
-
* anns_field: VECTOR_FIELD_NAME,
|
|
103
|
-
* topk: "4",
|
|
104
|
-
* metric_type: "L2",
|
|
105
|
-
* params: JSON.stringify({ nprobe: 1024 }),
|
|
106
|
-
* },
|
|
107
|
-
* output_fields: ["age", "time"],
|
|
108
|
-
* vector_type: 100,
|
|
96
|
+
* vector: [1, 2, 3, 4],
|
|
109
97
|
* });
|
|
110
98
|
* ```
|
|
111
99
|
*/
|
|
112
|
-
search(data: SearchReq): Promise<SearchResults>;
|
|
100
|
+
search(data: SearchReq | SearchSimpleReq): Promise<SearchResults>;
|
|
113
101
|
/**
|
|
114
102
|
* Milvus temporarily buffers the newly inserted vectors in the cache. Call `flush()` to persist them to the object storage.
|
|
115
103
|
* It's async function, so it's will take some times to excute.
|