@zilliz/milvus2-sdk-node 2.1.2 → 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 +65 -11
- package/dist/milvus/Collection.js +111 -35
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +71 -13
- package/dist/milvus/Data.js +153 -50
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/MilvusIndex.d.ts +5 -1
- package/dist/milvus/MilvusIndex.js +11 -9
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.d.ts +10 -6
- package/dist/milvus/Partition.js +15 -11
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/User.d.ts +3 -3
- package/dist/milvus/User.js +10 -10
- 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 +33 -5
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +16 -8
- package/dist/milvus/types/Common.d.ts +12 -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 +22 -8
- package/dist/milvus/types/Index.d.ts +7 -6
- package/dist/milvus/types/Partition.d.ts +5 -4
- 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 +13 -10
- package/dist/milvus/types/User.d.ts +6 -3
- 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 +71 -33
- package/dist/proto/proto/google/protobuf/descriptor.proto +17 -19
- package/dist/proto/proto/milvus.proto +293 -82
- package/dist/proto/proto/schema.proto +10 -2
- package/dist/sdk.json +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +12 -7
- package/dist/utils/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAkC;AAClC,kCAAqC;AACrC,mDAAoD;AACpD,iDAkB4B;AAC5B,6CAY0B;AAC1B,6CAAyD;AACzD,8CAAwB;AACxB,yCAAqE;AACrE,mCAAkC;AAElC,IAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AAE1E;;GAEG;AACH;IAAgC,8BAAM;IAAtC;;IAqoBA,CAAC;IApoBC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACG,qCAAgB,GAAtB,UAAuB,IAAyB;;;;;;wBACxC,KAKF,IAAI,IAAI,EAAE,EAJZ,MAAM,YAAA,EACN,eAAe,qBAAA,EACf,WAAW,iBAAA,EACX,yBAA6B,EAA7B,iBAAiB,mBAAG,SAAS,KAAA,CAChB;wBACf,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE;4BACjD,MAAM,IAAI,KAAK,CAAC,2BAAa,CAAC,8BAA8B,CAAC,CAAC;y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EACX,6BAA6B,EAC7B,IAAI,EACJ,IAAI,CAAC,OAAO,CACb,EAAA;;wBALK,GAAG,GAAG,SAKX;wBACD,sBAAO,GAAG,EAAC;;;;KACZ;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACG,gCAAW,GAAjB,UAAkB,IAAmB;;;;;;wBACnC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;4BAC/B,MAAM,IAAI,KAAK,CAAC,2BAAa,CAAC,yBAAyB,CAAC,CAAC;yBAC1D;wBACW,qBAAM,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAA;;wBAArE,GAAG,GAAG,SAA+D;wBAC3E,sBAAO,GAAG,EAAC;;;;KACZ;IACH,iBAAC;AAAD,CAAC,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[];
|
|
@@ -17,6 +17,7 @@ export declare class Data extends Client {
|
|
|
17
17
|
* | partition_name(optional)| String | Partition name |
|
|
18
18
|
* | fields_data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
|
|
19
19
|
* | hash_keys(optional) | Number[] | The hash value depends on the primarykey value |
|
|
20
|
+
* | 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 |
|
|
20
21
|
*
|
|
21
22
|
* @return
|
|
22
23
|
* | Property | Description |
|
|
@@ -49,6 +50,7 @@ export declare class Data extends Client {
|
|
|
49
50
|
* | collection_name | String | Collection name |
|
|
50
51
|
* | partition_name(optional)| String | Partition name |
|
|
51
52
|
* | expr | String | Boolean expression used to filter attribute. |
|
|
53
|
+
* | 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 |
|
|
52
54
|
*
|
|
53
55
|
* @return
|
|
54
56
|
* | Property | Description |
|
|
@@ -81,7 +83,8 @@ export declare class Data extends Client {
|
|
|
81
83
|
* | output_fields(optional) | String[] | Support scalar field |
|
|
82
84
|
* | vector_type | enum | Binary field -> 100, Float field -> 101 |
|
|
83
85
|
* | travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search.|
|
|
84
|
-
|
|
86
|
+
* | 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 |
|
|
87
|
+
*
|
|
85
88
|
* @return
|
|
86
89
|
* | Property | Description |
|
|
87
90
|
* | :-------------| :------------------------------- |
|
|
@@ -116,6 +119,7 @@ export declare class Data extends Client {
|
|
|
116
119
|
* | Property | Type | Description |
|
|
117
120
|
* | :---------------------- | :---- | :------------------------------- |
|
|
118
121
|
* | collection_names | String[] | Array of collection names |
|
|
122
|
+
* | 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 |
|
|
119
123
|
*
|
|
120
124
|
* @return
|
|
121
125
|
* | Property | Description |
|
|
@@ -139,6 +143,7 @@ export declare class Data extends Client {
|
|
|
139
143
|
* | Property | Type | Description |
|
|
140
144
|
* | :---------------------- | :---- | :------------------------------- |
|
|
141
145
|
* | collection_names | String[] | Array of collection names |
|
|
146
|
+
* | 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 |
|
|
142
147
|
*
|
|
143
148
|
* @return
|
|
144
149
|
* | Property | Description |
|
|
@@ -164,8 +169,8 @@ export declare class Data extends Client {
|
|
|
164
169
|
* | expr | String | Scalar field filter expression |
|
|
165
170
|
* | partitions_names(optional) | String[] | Array of partition names |
|
|
166
171
|
* | output_fields | String[] | Vector or scalar field to be returned |
|
|
167
|
-
*
|
|
168
|
-
*
|
|
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
|
+
* | params | {key: value}[] | An optional key pair json array
|
|
169
174
|
*
|
|
170
175
|
* @return
|
|
171
176
|
* | Property | Description |
|
|
@@ -193,11 +198,6 @@ export declare class Data extends Client {
|
|
|
193
198
|
* | request | object | Only allow "system_info" for now |
|
|
194
199
|
*/
|
|
195
200
|
getMetric(data: GetMetricsRequest): Promise<GetMetricsResponse>;
|
|
196
|
-
/**
|
|
197
|
-
* @ignore
|
|
198
|
-
* @param data
|
|
199
|
-
*/
|
|
200
|
-
calcDistance(data: CalcDistanceReq): Promise<CalcDistanceResponse>;
|
|
201
201
|
/**
|
|
202
202
|
* Get flush state by segment ids
|
|
203
203
|
*
|
|
@@ -205,7 +205,7 @@ export declare class Data extends Client {
|
|
|
205
205
|
* | Property | Type | Description |
|
|
206
206
|
* | :---------------------- | :---- | :------------------------------- |
|
|
207
207
|
* | segmentIDs | Array | The segment ids |
|
|
208
|
-
*
|
|
208
|
+
* | 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 |
|
|
209
209
|
*
|
|
210
210
|
*
|
|
211
211
|
* @return
|
|
@@ -234,7 +234,7 @@ export declare class Data extends Client {
|
|
|
234
234
|
* | src_nodeID | number | The source query node id to balance. |
|
|
235
235
|
* | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
|
|
236
236
|
* | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
|
|
237
|
-
*
|
|
237
|
+
* | 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 |
|
|
238
238
|
*
|
|
239
239
|
* @return
|
|
240
240
|
* | Property | Description |
|
|
@@ -259,7 +259,7 @@ export declare class Data extends Client {
|
|
|
259
259
|
* | Property | Type | Description |
|
|
260
260
|
* | :---------------------- | :---- | :------------------------------- |
|
|
261
261
|
* | collectionName | String | The name of the collection to get segments info. |
|
|
262
|
-
*
|
|
262
|
+
* | 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 |
|
|
263
263
|
*
|
|
264
264
|
*
|
|
265
265
|
* @return
|
|
@@ -278,4 +278,62 @@ export declare class Data extends Client {
|
|
|
278
278
|
* ```
|
|
279
279
|
*/
|
|
280
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>;
|
|
281
339
|
}
|
package/dist/milvus/Data.js
CHANGED
|
@@ -61,10 +61,14 @@ 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 __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
65
|
-
for (var i = 0,
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
65
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
66
|
+
if (ar || !(i in from)) {
|
|
67
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
68
|
+
ar[i] = from[i];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
68
72
|
};
|
|
69
73
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
70
74
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -100,6 +104,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
100
104
|
* | partition_name(optional)| String | Partition name |
|
|
101
105
|
* | fields_data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
|
|
102
106
|
* | hash_keys(optional) | Number[] | The hash value depends on the primarykey value |
|
|
107
|
+
* | 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 |
|
|
103
108
|
*
|
|
104
109
|
* @return
|
|
105
110
|
* | Property | Description |
|
|
@@ -149,7 +154,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
149
154
|
.map(function (v) { return ({
|
|
150
155
|
name: v.name,
|
|
151
156
|
type: v.data_type,
|
|
152
|
-
dim: Number(index_1.findKeyValue(v.type_params, 'dim')),
|
|
157
|
+
dim: Number((0, index_1.findKeyValue)(v.type_params, 'dim')),
|
|
153
158
|
value: [],
|
|
154
159
|
}); });
|
|
155
160
|
params = __assign(__assign({}, data), { num_rows: data.fields_data.length });
|
|
@@ -160,7 +165,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
160
165
|
fieldNames.forEach(function (name) {
|
|
161
166
|
var target = fieldsData.find(function (item) { return item.name === name; });
|
|
162
167
|
if (!target) {
|
|
163
|
-
throw new Error(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD
|
|
168
|
+
throw new Error("".concat(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD, " ").concat(i));
|
|
164
169
|
}
|
|
165
170
|
var isVector = _this.vectorTypes.includes(Common_1.DataTypeMap[target.type.toLowerCase()]);
|
|
166
171
|
// Check if the dimension is matched when the data type is BinaryVector.
|
|
@@ -233,7 +238,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
233
238
|
? (_c = {
|
|
234
239
|
dim: v.dim
|
|
235
240
|
},
|
|
236
|
-
_c[dataKey] = Blob_1.parseBinaryVectorToBytes(v.value),
|
|
241
|
+
_c[dataKey] = (0, Blob_1.parseBinaryVectorToBytes)(v.value),
|
|
237
242
|
_c) : (_d = {},
|
|
238
243
|
_d[dataKey] = {
|
|
239
244
|
data: v.value,
|
|
@@ -241,7 +246,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
241
246
|
_d),
|
|
242
247
|
_a;
|
|
243
248
|
});
|
|
244
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'Insert', params)];
|
|
249
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Insert', params, data.timeout)];
|
|
245
250
|
case 2:
|
|
246
251
|
promise = _a.sent();
|
|
247
252
|
return [2 /*return*/, promise];
|
|
@@ -258,6 +263,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
258
263
|
* | collection_name | String | Collection name |
|
|
259
264
|
* | partition_name(optional)| String | Partition name |
|
|
260
265
|
* | expr | String | Boolean expression used to filter attribute. |
|
|
266
|
+
* | 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 |
|
|
261
267
|
*
|
|
262
268
|
* @return
|
|
263
269
|
* | Property | Description |
|
|
@@ -284,7 +290,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
284
290
|
if (!data || !data.collection_name || !data.expr) {
|
|
285
291
|
throw new Error(ErrorReason_1.ERROR_REASONS.DELETE_PARAMS_CHECK);
|
|
286
292
|
}
|
|
287
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'Delete', data)];
|
|
293
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Delete', data, data.timeout)];
|
|
288
294
|
case 1:
|
|
289
295
|
promise = _a.sent();
|
|
290
296
|
return [2 /*return*/, promise];
|
|
@@ -306,7 +312,8 @@ var Data = /** @class */ (function (_super) {
|
|
|
306
312
|
* | output_fields(optional) | String[] | Support scalar field |
|
|
307
313
|
* | vector_type | enum | Binary field -> 100, Float field -> 101 |
|
|
308
314
|
* | travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search.|
|
|
309
|
-
|
|
315
|
+
* | 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 |
|
|
316
|
+
*
|
|
310
317
|
* @return
|
|
311
318
|
* | Property | Description |
|
|
312
319
|
* | :-------------| :------------------------------- |
|
|
@@ -336,7 +343,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
336
343
|
Data.prototype.search = function (data) {
|
|
337
344
|
var _a;
|
|
338
345
|
return __awaiter(this, void 0, void 0, function () {
|
|
339
|
-
var root, collectionInfo, targetField, dim, vectorType, dimension, PlaceholderGroup, placeholderGroupParams, placeholderGroupBytes, promise, results,
|
|
346
|
+
var root, collectionInfo, targetField, dim, vectorType, dimension, round_decimal, PlaceholderGroup, placeholderGroupParams, placeholderGroupBytes, promise, results, _b, topks, scores_1, fields_data, ids, fieldsData_1, idData_1;
|
|
340
347
|
return __generator(this, function (_c) {
|
|
341
348
|
switch (_c.label) {
|
|
342
349
|
case 0: return [4 /*yield*/, protobufjs_1.default.load(protoPath)];
|
|
@@ -361,12 +368,19 @@ var Data = /** @class */ (function (_super) {
|
|
|
361
368
|
if (!targetField) {
|
|
362
369
|
throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_NOT_FIND_VECTOR_FIELD);
|
|
363
370
|
}
|
|
364
|
-
dim = index_1.findKeyValue(targetField.type_params, 'dim');
|
|
371
|
+
dim = (0, index_1.findKeyValue)(targetField.type_params, 'dim');
|
|
365
372
|
vectorType = Common_1.DataTypeMap[targetField.data_type.toLowerCase()];
|
|
366
373
|
dimension = vectorType === Common_1.DataType.BinaryVector ? Number(dim) / 8 : Number(dim);
|
|
367
374
|
if (!data.vectors[0] || data.vectors[0].length !== dimension) {
|
|
368
375
|
throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_DIM_NOT_MATCH);
|
|
369
376
|
}
|
|
377
|
+
round_decimal = data.search_params.round_decimal;
|
|
378
|
+
if (round_decimal !== undefined &&
|
|
379
|
+
(!Number.isInteger(round_decimal) ||
|
|
380
|
+
round_decimal < -1 ||
|
|
381
|
+
round_decimal > 6)) {
|
|
382
|
+
throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_ROUND_DECIMAL_NOT_VALID);
|
|
383
|
+
}
|
|
370
384
|
PlaceholderGroup = root.lookupType('milvus.proto.common.PlaceholderGroup');
|
|
371
385
|
placeholderGroupParams = PlaceholderGroup.create({
|
|
372
386
|
placeholders: [
|
|
@@ -375,18 +389,23 @@ var Data = /** @class */ (function (_super) {
|
|
|
375
389
|
type: data.vector_type,
|
|
376
390
|
values: data.vectors.map(function (v) {
|
|
377
391
|
return data.vector_type === Common_1.DataType.BinaryVector
|
|
378
|
-
? Blob_1.parseBinaryVectorToBytes(v)
|
|
379
|
-
: Blob_1.parseFloatVectorToBytes(v);
|
|
392
|
+
? (0, Blob_1.parseBinaryVectorToBytes)(v)
|
|
393
|
+
: (0, Blob_1.parseFloatVectorToBytes)(v);
|
|
380
394
|
}),
|
|
381
395
|
},
|
|
382
396
|
],
|
|
383
397
|
});
|
|
384
398
|
placeholderGroupBytes = PlaceholderGroup.encode(placeholderGroupParams).finish();
|
|
385
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'Search', __assign(__assign({}, data), { dsl: data.expr || '', dsl_type: Common_1.DslType.BoolExprV1, placeholder_group: placeholderGroupBytes, search_params: Format_1.parseToKeyValue(data.search_params) }))];
|
|
399
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Search', __assign(__assign({}, data), { nq: data.nq || data.vectors.length, dsl: data.expr || '', dsl_type: Common_1.DslType.BoolExprV1, placeholder_group: placeholderGroupBytes, search_params: (0, Format_1.parseToKeyValue)(data.search_params) }), data.timeout)];
|
|
386
400
|
case 3:
|
|
387
401
|
promise = _c.sent();
|
|
388
402
|
results = [];
|
|
389
|
-
|
|
403
|
+
/**
|
|
404
|
+
* It will decide the score precision.
|
|
405
|
+
* If round_decimal is 3, need return like 3.142
|
|
406
|
+
* And if Milvus return like 3.142, Node will add more number after this like 3.142000047683716.
|
|
407
|
+
* So the score need to slice by round_decimal
|
|
408
|
+
*/
|
|
390
409
|
if (promise.results) {
|
|
391
410
|
_b = promise.results, topks = _b.topks, scores_1 = _b.scores, fields_data = _b.fields_data, ids = _b.ids;
|
|
392
411
|
fieldsData_1 = fields_data.map(function (item, i) {
|
|
@@ -411,7 +430,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
411
430
|
var i = index === 0 ? scoreIndex : scoreIndex + topk;
|
|
412
431
|
var fixedScore = typeof round_decimal === 'undefined' || round_decimal === -1
|
|
413
432
|
? score
|
|
414
|
-
: Format_1.formatNumberPrecision(score, round_decimal);
|
|
433
|
+
: (0, Format_1.formatNumberPrecision)(score, round_decimal);
|
|
415
434
|
var result = {
|
|
416
435
|
score: fixedScore,
|
|
417
436
|
id: idData_1 ? idData_1[i] : '',
|
|
@@ -438,6 +457,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
438
457
|
* | Property | Type | Description |
|
|
439
458
|
* | :---------------------- | :---- | :------------------------------- |
|
|
440
459
|
* | collection_names | String[] | Array of collection names |
|
|
460
|
+
* | 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 |
|
|
441
461
|
*
|
|
442
462
|
* @return
|
|
443
463
|
* | Property | Description |
|
|
@@ -463,7 +483,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
463
483
|
!data.collection_names.length) {
|
|
464
484
|
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
465
485
|
}
|
|
466
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'Flush', data)];
|
|
486
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout)];
|
|
467
487
|
case 1:
|
|
468
488
|
res = _a.sent();
|
|
469
489
|
return [2 /*return*/, res];
|
|
@@ -479,6 +499,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
479
499
|
* | Property | Type | Description |
|
|
480
500
|
* | :---------------------- | :---- | :------------------------------- |
|
|
481
501
|
* | collection_names | String[] | Array of collection names |
|
|
502
|
+
* | 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 |
|
|
482
503
|
*
|
|
483
504
|
* @return
|
|
484
505
|
* | Property | Description |
|
|
@@ -504,12 +525,12 @@ var Data = /** @class */ (function (_super) {
|
|
|
504
525
|
!data.collection_names.length) {
|
|
505
526
|
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
506
527
|
}
|
|
507
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'Flush', data)];
|
|
528
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout)];
|
|
508
529
|
case 1:
|
|
509
530
|
res = _a.sent();
|
|
510
531
|
segIDs = Object.keys(res.coll_segIDs)
|
|
511
532
|
.map(function (v) { return res.coll_segIDs[v].data; })
|
|
512
|
-
.reduce(function (pre, cur) { return __spreadArray(__spreadArray([], pre), cur); }, []);
|
|
533
|
+
.reduce(function (pre, cur) { return __spreadArray(__spreadArray([], pre, true), cur, true); }, []);
|
|
513
534
|
isFlushed = false;
|
|
514
535
|
flushRes = null;
|
|
515
536
|
_a.label = 2;
|
|
@@ -518,7 +539,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
518
539
|
return [4 /*yield*/, this.getFlushState({ segmentIDs: segIDs })];
|
|
519
540
|
case 3:
|
|
520
541
|
flushRes = _a.sent();
|
|
521
|
-
return [4 /*yield*/, index_1.sleep(100)];
|
|
542
|
+
return [4 /*yield*/, (0, index_1.sleep)(100)];
|
|
522
543
|
case 4:
|
|
523
544
|
_a.sent();
|
|
524
545
|
isFlushed = flushRes.flushed;
|
|
@@ -540,8 +561,8 @@ var Data = /** @class */ (function (_super) {
|
|
|
540
561
|
* | expr | String | Scalar field filter expression |
|
|
541
562
|
* | partitions_names(optional) | String[] | Array of partition names |
|
|
542
563
|
* | output_fields | String[] | Vector or scalar field to be returned |
|
|
543
|
-
*
|
|
544
|
-
*
|
|
564
|
+
* | 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 |
|
|
565
|
+
* | params | {key: value}[] | An optional key pair json array
|
|
545
566
|
*
|
|
546
567
|
* @return
|
|
547
568
|
* | Property | Description |
|
|
@@ -562,12 +583,18 @@ var Data = /** @class */ (function (_super) {
|
|
|
562
583
|
*/
|
|
563
584
|
Data.prototype.query = function (data) {
|
|
564
585
|
return __awaiter(this, void 0, void 0, function () {
|
|
565
|
-
var promise, results, fieldsData;
|
|
586
|
+
var limits, offset, promise, results, fieldsData;
|
|
566
587
|
return __generator(this, function (_a) {
|
|
567
588
|
switch (_a.label) {
|
|
568
589
|
case 0:
|
|
569
590
|
this.checkCollectionName(data);
|
|
570
|
-
|
|
591
|
+
if (typeof data.limit === 'number') {
|
|
592
|
+
limits = { limit: data.limit };
|
|
593
|
+
}
|
|
594
|
+
if (typeof data.offset === 'number') {
|
|
595
|
+
offset = { offset: data.offset };
|
|
596
|
+
}
|
|
597
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Query', __assign(__assign({}, data), { query_params: (0, Format_1.parseToKeyValue)(__assign(__assign({}, limits), offset)) }), data.timeout)];
|
|
571
598
|
case 1:
|
|
572
599
|
promise = _a.sent();
|
|
573
600
|
results = [];
|
|
@@ -641,9 +668,9 @@ var Data = /** @class */ (function (_super) {
|
|
|
641
668
|
if (!data || !data.request || !data.request.metric_type) {
|
|
642
669
|
throw new Error(ErrorReason_1.ERROR_REASONS.GET_METRIC_CHECK_PARAMS);
|
|
643
670
|
}
|
|
644
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetMetrics', {
|
|
671
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetMetrics', {
|
|
645
672
|
request: JSON.stringify(data.request),
|
|
646
|
-
})];
|
|
673
|
+
}, data.timeout)];
|
|
647
674
|
case 1:
|
|
648
675
|
res = _a.sent();
|
|
649
676
|
return [2 /*return*/, __assign(__assign({}, res), { response: JSON.parse(res.response) })];
|
|
@@ -651,23 +678,6 @@ var Data = /** @class */ (function (_super) {
|
|
|
651
678
|
});
|
|
652
679
|
});
|
|
653
680
|
};
|
|
654
|
-
/**
|
|
655
|
-
* @ignore
|
|
656
|
-
* @param data
|
|
657
|
-
*/
|
|
658
|
-
Data.prototype.calcDistance = function (data) {
|
|
659
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
660
|
-
var res;
|
|
661
|
-
return __generator(this, function (_a) {
|
|
662
|
-
switch (_a.label) {
|
|
663
|
-
case 0: return [4 /*yield*/, utils_1.promisify(this.client, 'CalcDistance', data)];
|
|
664
|
-
case 1:
|
|
665
|
-
res = _a.sent();
|
|
666
|
-
return [2 /*return*/, res];
|
|
667
|
-
}
|
|
668
|
-
});
|
|
669
|
-
});
|
|
670
|
-
};
|
|
671
681
|
/**
|
|
672
682
|
* Get flush state by segment ids
|
|
673
683
|
*
|
|
@@ -675,7 +685,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
675
685
|
* | Property | Type | Description |
|
|
676
686
|
* | :---------------------- | :---- | :------------------------------- |
|
|
677
687
|
* | segmentIDs | Array | The segment ids |
|
|
678
|
-
*
|
|
688
|
+
* | 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 |
|
|
679
689
|
*
|
|
680
690
|
*
|
|
681
691
|
* @return
|
|
@@ -702,7 +712,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
702
712
|
if (!data || !data.segmentIDs) {
|
|
703
713
|
throw new Error(ErrorReason_1.ERROR_REASONS.GET_FLUSH_STATE_CHECK_PARAMS);
|
|
704
714
|
}
|
|
705
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetFlushState', data)];
|
|
715
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetFlushState', data, data.timeout)];
|
|
706
716
|
case 1:
|
|
707
717
|
res = _a.sent();
|
|
708
718
|
return [2 /*return*/, res];
|
|
@@ -720,7 +730,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
720
730
|
* | src_nodeID | number | The source query node id to balance. |
|
|
721
731
|
* | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
|
|
722
732
|
* | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
|
|
723
|
-
*
|
|
733
|
+
* | 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 |
|
|
724
734
|
*
|
|
725
735
|
* @return
|
|
726
736
|
* | Property | Description |
|
|
@@ -746,7 +756,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
746
756
|
if (!data || !data.src_nodeID) {
|
|
747
757
|
throw new Error(ErrorReason_1.ERROR_REASONS.LOAD_BALANCE_CHECK_PARAMS);
|
|
748
758
|
}
|
|
749
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'LoadBalance', data)];
|
|
759
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadBalance', data, data.timeout)];
|
|
750
760
|
case 1:
|
|
751
761
|
res = _a.sent();
|
|
752
762
|
return [2 /*return*/, res];
|
|
@@ -761,7 +771,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
761
771
|
* | Property | Type | Description |
|
|
762
772
|
* | :---------------------- | :---- | :------------------------------- |
|
|
763
773
|
* | collectionName | String | The name of the collection to get segments info. |
|
|
764
|
-
*
|
|
774
|
+
* | 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 |
|
|
765
775
|
*
|
|
766
776
|
*
|
|
767
777
|
* @return
|
|
@@ -788,7 +798,100 @@ var Data = /** @class */ (function (_super) {
|
|
|
788
798
|
if (!data || !data.collectionName) {
|
|
789
799
|
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
790
800
|
}
|
|
791
|
-
return [4 /*yield*/, utils_1.promisify(this.client, 'GetQuerySegmentInfo', data)];
|
|
801
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetQuerySegmentInfo', data, data.timeout)];
|
|
802
|
+
case 1:
|
|
803
|
+
res = _a.sent();
|
|
804
|
+
return [2 /*return*/, res];
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
/**
|
|
810
|
+
* Import data from files
|
|
811
|
+
*
|
|
812
|
+
* @param data
|
|
813
|
+
* | Property | Type | Description |
|
|
814
|
+
* | :---------------------- | :---- | :------------------------------- |
|
|
815
|
+
* | collection_name | String | The name of the collection |
|
|
816
|
+
* | files | string[] | File path array |
|
|
817
|
+
*
|
|
818
|
+
*
|
|
819
|
+
* @return
|
|
820
|
+
* | Property | Description |
|
|
821
|
+
* | :-----------| :------------------------------- |
|
|
822
|
+
* | status | { error_code: number,reason:string } |
|
|
823
|
+
* | tasks | taskId array |
|
|
824
|
+
*
|
|
825
|
+
*
|
|
826
|
+
* #### Example
|
|
827
|
+
*
|
|
828
|
+
* ```
|
|
829
|
+
* const res = await dataManager.bulkInsert({
|
|
830
|
+
* collection_name: COLLECTION,
|
|
831
|
+
* files: [`path-to-data-file.json`]
|
|
832
|
+
* });
|
|
833
|
+
* ```
|
|
834
|
+
*/
|
|
835
|
+
Data.prototype.bulkInsert = function (data) {
|
|
836
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
837
|
+
var res;
|
|
838
|
+
return __generator(this, function (_a) {
|
|
839
|
+
switch (_a.label) {
|
|
840
|
+
case 0:
|
|
841
|
+
if (!data || !data.collection_name) {
|
|
842
|
+
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
843
|
+
}
|
|
844
|
+
if (!data || !data.files) {
|
|
845
|
+
throw new Error(ErrorReason_1.ERROR_REASONS.IMPORT_FILE_CHECK);
|
|
846
|
+
}
|
|
847
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Import', __assign(__assign({}, data), { options: data.options || [] }), data.timeout)];
|
|
848
|
+
case 1:
|
|
849
|
+
res = _a.sent();
|
|
850
|
+
return [2 /*return*/, res];
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
});
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* List import tasks
|
|
857
|
+
*
|
|
858
|
+
* @param data
|
|
859
|
+
* | Property | Type | Description |
|
|
860
|
+
* | :---------------------- | :---- | :------------------------------- |
|
|
861
|
+
* | collection_name | String | The name of the collection |
|
|
862
|
+
* | limit | number | optional, maximum number of tasks returned, list all tasks if the value is 0 |
|
|
863
|
+
*
|
|
864
|
+
*
|
|
865
|
+
* @return
|
|
866
|
+
* | Property | Description |
|
|
867
|
+
* | :-----------| :------------------------------- |
|
|
868
|
+
* | status | { error_code: number,reason:string } |
|
|
869
|
+
* | state | import state |
|
|
870
|
+
* | row_count | how many rows to import|
|
|
871
|
+
* | id_list| id lists |
|
|
872
|
+
* | collection_id | collection to be imported to |
|
|
873
|
+
* |
|
|
874
|
+
* | tasks | taskId array |
|
|
875
|
+
*
|
|
876
|
+
*
|
|
877
|
+
* #### Example
|
|
878
|
+
*
|
|
879
|
+
* ```
|
|
880
|
+
* const res = await dataManager.listImportTasks({
|
|
881
|
+
* collection_name: COLLECTION
|
|
882
|
+
* });
|
|
883
|
+
* ```
|
|
884
|
+
*/
|
|
885
|
+
Data.prototype.listImportTasks = function (data) {
|
|
886
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
887
|
+
var res;
|
|
888
|
+
return __generator(this, function (_a) {
|
|
889
|
+
switch (_a.label) {
|
|
890
|
+
case 0:
|
|
891
|
+
if (!data || !data.collection_name) {
|
|
892
|
+
throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
893
|
+
}
|
|
894
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ListImportTasks', __assign(__assign({}, data), { limit: data.limit || 0 }), data.timeout)];
|
|
792
895
|
case 1:
|
|
793
896
|
res = _a.sent();
|
|
794
897
|
return [2 /*return*/, res];
|