@zilliz/milvus2-sdk-node 2.2.7 → 2.2.9
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 -23
- package/dist/milvus/BaseClient.d.ts +7 -4
- package/dist/milvus/BaseClient.js +8 -33
- package/dist/milvus/BaseClient.js.map +1 -1
- package/dist/milvus/Collection.js +19 -19
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +3 -1
- package/dist/milvus/Data.js +18 -14
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/GrpcClient.d.ts +32 -0
- package/dist/milvus/GrpcClient.js +236 -0
- package/dist/milvus/GrpcClient.js.map +1 -0
- package/dist/milvus/MilvusClient.d.ts +5 -16
- package/dist/milvus/MilvusClient.js +10 -138
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/MilvusIndex.js +5 -5
- 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/Milvus.d.ts +3 -0
- package/dist/milvus/const/Milvus.js +4 -1
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/index.d.ts +2 -0
- package/dist/milvus/index.js +2 -0
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +7 -1
- package/dist/milvus/types/Data.d.ts +2 -0
- package/dist/proto/proto/google/protobuf/descriptor.proto +1 -1
- package/dist/sdk.json +1 -1
- package/dist/utils/Format.d.ts +7 -0
- package/dist/utils/Format.js +12 -1
- package/dist/utils/Format.js.map +1 -1
- package/dist/utils/Grpc.d.ts +14 -0
- package/dist/utils/Grpc.js +107 -1
- package/dist/utils/Grpc.js.map +1 -1
- package/dist/utils/Validate.d.ts +11 -0
- package/dist/utils/Validate.js +20 -1
- package/dist/utils/Validate.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://badges.aleen42.com/src/typescript.svg)
|
|
2
|
-
[](https://img.shields.io/npm/v/@zilliz/milvus2-sdk-node)
|
|
3
|
-
[](https://img.shields.io/npm/dw/@zilliz/milvus2-sdk-node)
|
|
2
|
+
[](https://img.shields.io/npm/v/@zilliz/milvus2-sdk-node)
|
|
3
|
+
[](https://img.shields.io/npm/dw/@zilliz/milvus2-sdk-node)
|
|
4
4
|
[](https://codecov.io/gh/milvus-io/milvus-sdk-node)
|
|
5
5
|
|
|
6
6
|
# Milvus2-sdk-node
|
|
@@ -20,7 +20,8 @@ The following collection shows Milvus versions and recommended @zilliz/milvus2-s
|
|
|
20
20
|
|
|
21
21
|
## Dependencies
|
|
22
22
|
|
|
23
|
-
- Milvus
|
|
23
|
+
- [Milvus](https://milvus.io/)
|
|
24
|
+
- [Zilliz Cloud](https://cloud.zilliz.com/signup)
|
|
24
25
|
- Node: v12+
|
|
25
26
|
|
|
26
27
|
## Installation
|
|
@@ -64,7 +65,7 @@ npm install @zilliz/milvus2-sdk-node
|
|
|
64
65
|
|
|
65
66
|
```shell
|
|
66
67
|
# Download the milvus standalone yaml file
|
|
67
|
-
$ wget https://github.com/milvus-io/milvus/releases/download/v2.2.
|
|
68
|
+
$ wget https://github.com/milvus-io/milvus/releases/download/v2.2.8/milvus-standalone-docker-compose.yml -O docker-compose.yml
|
|
68
69
|
|
|
69
70
|
# start the milvus server
|
|
70
71
|
sudo docker-compose up -d
|
|
@@ -77,12 +78,24 @@ Create a new app.js file and add the following code to try out some basic vector
|
|
|
77
78
|
```javascript
|
|
78
79
|
import { MilvusClient, DataType } from '@zilliz/milvus2-sdk-node';
|
|
79
80
|
|
|
80
|
-
const
|
|
81
|
+
const address = 'your-milvus-ip';
|
|
82
|
+
const username = 'your-milvus-username'; // optional username
|
|
83
|
+
const password = 'your-milvus-password'; // optional password
|
|
84
|
+
const ssl = false; // secure or not
|
|
81
85
|
|
|
82
86
|
// connect to milvus
|
|
83
|
-
const client = new MilvusClient(
|
|
87
|
+
const client = new MilvusClient({ address, ssl, username, password });
|
|
84
88
|
```
|
|
85
89
|
|
|
90
|
+
| Parameters | Description | Type | Example |
|
|
91
|
+
| ----------- | --------------------------------------------------------------------------------- | ------- | ------------------- |
|
|
92
|
+
| address | The Milvus IP address | String | '192.168.0.1:19530' |
|
|
93
|
+
| ssl? | SSL connection. It is false by default. | Boolean | false |
|
|
94
|
+
| username? | The username used to connect to Milvus | String | milvus |
|
|
95
|
+
| address? | The password used to connect to Milvus | String | milvus |
|
|
96
|
+
| maxRetries? | The number of retries for the grpc method, by default: 3 | Number | 3 |
|
|
97
|
+
| retryDelay? | The delay between attempts at retrying a failed grpc method in ms, by default: 30 | Number | 30 |
|
|
98
|
+
|
|
86
99
|
### define schema for collection
|
|
87
100
|
|
|
88
101
|
```javascript
|
|
@@ -106,9 +119,7 @@ const schema = [
|
|
|
106
119
|
name: `book_intro`,
|
|
107
120
|
description: `word count`,
|
|
108
121
|
data_type: DataType.FloatVector,
|
|
109
|
-
|
|
110
|
-
dim: dim,
|
|
111
|
-
},
|
|
122
|
+
dim: dim,
|
|
112
123
|
},
|
|
113
124
|
];
|
|
114
125
|
```
|
|
@@ -159,10 +170,8 @@ await client.createIndex({
|
|
|
159
170
|
collection_name,
|
|
160
171
|
field_name: 'book_intro',
|
|
161
172
|
index_name: 'myindex',
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
metric_type: 'L2',
|
|
165
|
-
},
|
|
173
|
+
index_type: 'IVF_FLAT',
|
|
174
|
+
metric_type: 'L2',
|
|
166
175
|
});
|
|
167
176
|
// load collection
|
|
168
177
|
await client.loadCollectionSync({
|
|
@@ -178,16 +187,13 @@ const searchVector = [...Array(dim)].map(() => Math.random());
|
|
|
178
187
|
|
|
179
188
|
// Perform a vector search on the collection
|
|
180
189
|
const res = await client.search({
|
|
181
|
-
collection_name,
|
|
182
|
-
vectors: [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
|
190
|
+
collection_name, // required, the collection name
|
|
191
|
+
vectors: [0.1, 0.2, 0.3, 0.4], // required, vector used to compare other vectors in milvus
|
|
192
|
+
filter: 'word_count > 0', // optional, filter
|
|
193
|
+
params: { nprobe: 64 }, // optional, specify the search parameters
|
|
194
|
+
limit: 1, // specify the number of nearest neighbors to return
|
|
195
|
+
metric_type: 'L2', // optional, metric to calculate similarity of two vectors
|
|
196
|
+
output_fields: ['book_id', 'word_count'], // optional, specify the fields to return in the search results
|
|
191
197
|
});
|
|
192
198
|
```
|
|
193
199
|
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { Root } from 'protobufjs';
|
|
2
2
|
import { Client, ChannelOptions } from '@grpc/grpc-js';
|
|
3
|
-
import {
|
|
3
|
+
import { ClientConfig } from '.';
|
|
4
4
|
export declare class BaseClient {
|
|
5
|
+
client: Client | undefined;
|
|
6
|
+
protoPath: string;
|
|
5
7
|
schemaProto: Root;
|
|
6
8
|
milvusProto: Root;
|
|
7
|
-
|
|
9
|
+
config: ClientConfig;
|
|
8
10
|
timeout: number;
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
12
|
+
* setup the configuration object
|
|
11
13
|
*
|
|
12
14
|
* @param configOrAddress The configuration object or the Milvus address as a string.
|
|
13
15
|
* @param ssl Whether to use SSL or not. Default is false.
|
|
14
16
|
* @param username The username for authentication. Required if password is provided.
|
|
15
17
|
* @param password The password for authentication. Required if username is provided.
|
|
16
18
|
*/
|
|
17
|
-
constructor(configOrAddress:
|
|
19
|
+
constructor(configOrAddress: ClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions);
|
|
20
|
+
connect(): void;
|
|
18
21
|
}
|
|
@@ -1,15 +1,4 @@
|
|
|
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
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -17,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
6
|
exports.BaseClient = void 0;
|
|
18
7
|
var path_1 = __importDefault(require("path"));
|
|
19
8
|
var protobufjs_1 = __importDefault(require("protobufjs"));
|
|
20
|
-
var grpc_js_1 = require("@grpc/grpc-js");
|
|
21
9
|
var _1 = require(".");
|
|
22
10
|
var utils_1 = require("../utils");
|
|
23
11
|
// path
|
|
@@ -26,7 +14,7 @@ var schemaProtoPath = path_1.default.resolve(__dirname, '../proto/proto/schema.p
|
|
|
26
14
|
// Base Client
|
|
27
15
|
var BaseClient = /** @class */ (function () {
|
|
28
16
|
/**
|
|
29
|
-
*
|
|
17
|
+
* setup the configuration object
|
|
30
18
|
*
|
|
31
19
|
* @param configOrAddress The configuration object or the Milvus address as a string.
|
|
32
20
|
* @param ssl Whether to use SSL or not. Default is false.
|
|
@@ -34,6 +22,8 @@ var BaseClient = /** @class */ (function () {
|
|
|
34
22
|
* @param password The password for authentication. Required if username is provided.
|
|
35
23
|
*/
|
|
36
24
|
function BaseClient(configOrAddress, ssl, username, password, channelOptions) {
|
|
25
|
+
// timeout:
|
|
26
|
+
this.timeout = _1.DEFAULT_CONNECT_TIMEOUT;
|
|
37
27
|
var config;
|
|
38
28
|
// If a configuration object is provided, use it. Otherwise, create a new object with the provided parameters.
|
|
39
29
|
if (typeof configOrAddress === 'object') {
|
|
@@ -52,18 +42,10 @@ var BaseClient = /** @class */ (function () {
|
|
|
52
42
|
if (!config.address) {
|
|
53
43
|
throw new Error(_1.ERROR_REASONS.MILVUS_ADDRESS_IS_REQUIRED);
|
|
54
44
|
}
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
// get Milvus GRPC service
|
|
58
|
-
var MilvusService = (0, utils_1.getGRPCService)({
|
|
59
|
-
protoPath: protoPath,
|
|
60
|
-
serviceName: 'milvus.proto.milvus.MilvusService', // the name of the Milvus service
|
|
61
|
-
});
|
|
62
|
-
// create interceptors
|
|
63
|
-
var interceptors = needAuth
|
|
64
|
-
? (0, utils_1.getAuthInterceptor)(config.username, config.password)
|
|
65
|
-
: null;
|
|
45
|
+
// assign config
|
|
46
|
+
this.config = config;
|
|
66
47
|
// load proto
|
|
48
|
+
this.protoPath = protoPath;
|
|
67
49
|
this.schemaProto = protobufjs_1.default.loadSync(schemaProtoPath);
|
|
68
50
|
this.milvusProto = protobufjs_1.default.loadSync(protoPath);
|
|
69
51
|
// setup timeout
|
|
@@ -71,16 +53,9 @@ var BaseClient = /** @class */ (function () {
|
|
|
71
53
|
typeof config.timeout === 'string'
|
|
72
54
|
? (0, utils_1.parseTimeToken)(config.timeout)
|
|
73
55
|
: config.timeout || _1.DEFAULT_CONNECT_TIMEOUT;
|
|
74
|
-
// options
|
|
75
|
-
var options = __assign({ interceptors: [interceptors],
|
|
76
|
-
// Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
|
|
77
|
-
// So SDK should support max_receive_message_length unlimited.
|
|
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);
|
|
83
56
|
}
|
|
57
|
+
// connect interface
|
|
58
|
+
BaseClient.prototype.connect = function () { };
|
|
84
59
|
return BaseClient;
|
|
85
60
|
}());
|
|
86
61
|
exports.BaseClient = BaseClient;
|
|
@@ -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;AAE5C,sBAAyE;AACzE,kCAA0C;AAE1C,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;IAcE;;;;;;;OAOG;IACH,oBACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QAhBjC,WAAW;QACX,YAAO,GAAW,0BAAuB,CAAC;QAiBxC,IAAI,MAAoB,CAAC;QAEzB,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,gBAAgB;QAChB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,aAAa;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,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;IAClD,CAAC;IAED,oBAAoB;IACpB,4BAAO,GAAP,cAAW,CAAC;IACd,iBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,gCAAU"}
|
|
@@ -157,7 +157,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
157
157
|
collectionParams = CollectionSchema.create(payload);
|
|
158
158
|
schemaBytes = CollectionSchema.encode(collectionParams).finish();
|
|
159
159
|
level = (_a = _1.ConsistencyLevelEnum[consistency_level]) !== null && _a !== void 0 ? _a : _1.ConsistencyLevelEnum.Bounded;
|
|
160
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
160
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateCollection', __assign(__assign({}, data), { schema: schemaBytes, consistency_level: level }), data.timeout || this.timeout)];
|
|
161
161
|
case 1:
|
|
162
162
|
promise = _d.sent();
|
|
163
163
|
// Return the promise.
|
|
@@ -197,7 +197,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
197
197
|
switch (_a.label) {
|
|
198
198
|
case 0:
|
|
199
199
|
(0, utils_1.checkCollectionName)(data);
|
|
200
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
200
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'HasCollection', data, data.timeout || this.timeout)];
|
|
201
201
|
case 1:
|
|
202
202
|
promise = _a.sent();
|
|
203
203
|
return [2 /*return*/, promise];
|
|
@@ -234,7 +234,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
234
234
|
var promise, result;
|
|
235
235
|
return __generator(this, function (_a) {
|
|
236
236
|
switch (_a.label) {
|
|
237
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
237
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ShowCollections', {
|
|
238
238
|
type: data ? data.type : _1.ShowCollectionsType.All,
|
|
239
239
|
collection_names: (data === null || data === void 0 ? void 0 : data.collection_names) || [],
|
|
240
240
|
}, (data === null || data === void 0 ? void 0 : data.timeout) || this.timeout)];
|
|
@@ -287,7 +287,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
287
287
|
switch (_a.label) {
|
|
288
288
|
case 0:
|
|
289
289
|
(0, utils_1.checkCollectionName)(data);
|
|
290
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
290
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DescribeCollection', data, data.timeout || this.timeout)];
|
|
291
291
|
case 1:
|
|
292
292
|
promise = _a.sent();
|
|
293
293
|
return [2 /*return*/, promise];
|
|
@@ -327,7 +327,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
327
327
|
switch (_a.label) {
|
|
328
328
|
case 0:
|
|
329
329
|
(0, utils_1.checkCollectionName)(data);
|
|
330
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
330
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCollectionStatistics', data, data.timeout || this.timeout)];
|
|
331
331
|
case 1:
|
|
332
332
|
promise = _a.sent();
|
|
333
333
|
promise.data = (0, utils_1.formatKeyValueData)(promise.stats, ['row_count']);
|
|
@@ -369,7 +369,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
369
369
|
switch (_a.label) {
|
|
370
370
|
case 0:
|
|
371
371
|
(0, utils_1.checkCollectionName)(data);
|
|
372
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
372
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadCollection', data, data.timeout || this.timeout)];
|
|
373
373
|
case 1:
|
|
374
374
|
promise = _a.sent();
|
|
375
375
|
return [2 /*return*/, promise];
|
|
@@ -410,7 +410,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
410
410
|
switch (_a.label) {
|
|
411
411
|
case 0:
|
|
412
412
|
(0, utils_1.checkCollectionName)(data);
|
|
413
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
413
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadCollection', data, data.timeout || this.timeout)];
|
|
414
414
|
case 1:
|
|
415
415
|
promise = _a.sent();
|
|
416
416
|
if (promise.error_code !== _1.ErrorCode.SUCCESS) {
|
|
@@ -471,7 +471,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
471
471
|
switch (_a.label) {
|
|
472
472
|
case 0:
|
|
473
473
|
(0, utils_1.checkCollectionName)(data);
|
|
474
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
474
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ReleaseCollection', data, data.timeout || this.timeout)];
|
|
475
475
|
case 1:
|
|
476
476
|
promise = _a.sent();
|
|
477
477
|
return [2 /*return*/, promise];
|
|
@@ -509,7 +509,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
509
509
|
var promise;
|
|
510
510
|
return __generator(this, function (_a) {
|
|
511
511
|
switch (_a.label) {
|
|
512
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
512
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'RenameCollection', {
|
|
513
513
|
oldName: data.collection_name,
|
|
514
514
|
newName: data.new_collection_name,
|
|
515
515
|
}, data.timeout || this.timeout)];
|
|
@@ -550,7 +550,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
550
550
|
switch (_a.label) {
|
|
551
551
|
case 0:
|
|
552
552
|
(0, utils_1.checkCollectionName)(data);
|
|
553
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
553
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropCollection', data, data.timeout || this.timeout)];
|
|
554
554
|
case 1:
|
|
555
555
|
promise = _a.sent();
|
|
556
556
|
return [2 /*return*/, promise];
|
|
@@ -594,7 +594,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
594
594
|
if (!data.alias) {
|
|
595
595
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
596
596
|
}
|
|
597
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
597
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateAlias', data, data.timeout || this.timeout)];
|
|
598
598
|
case 1:
|
|
599
599
|
promise = _a.sent();
|
|
600
600
|
return [2 /*return*/, promise];
|
|
@@ -637,7 +637,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
637
637
|
if (!data.alias) {
|
|
638
638
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
639
639
|
}
|
|
640
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
640
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropAlias', data, data.timeout || this.timeout)];
|
|
641
641
|
case 1:
|
|
642
642
|
promise = _a.sent();
|
|
643
643
|
return [2 /*return*/, promise];
|
|
@@ -681,7 +681,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
681
681
|
if (!data.alias) {
|
|
682
682
|
throw new Error(_1.ERROR_REASONS.ALIAS_NAME_IS_REQUIRED);
|
|
683
683
|
}
|
|
684
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
684
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'AlterAlias', data, data.timeout || this.timeout)];
|
|
685
685
|
case 1:
|
|
686
686
|
promise = _a.sent();
|
|
687
687
|
return [2 /*return*/, promise];
|
|
@@ -722,7 +722,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
722
722
|
return [4 /*yield*/, this.describeCollection(data)];
|
|
723
723
|
case 1:
|
|
724
724
|
collectionInfo = _a.sent();
|
|
725
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
725
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ManualCompaction', {
|
|
726
726
|
collectionID: collectionInfo.collectionID,
|
|
727
727
|
}, data.timeout || this.timeout)];
|
|
728
728
|
case 2:
|
|
@@ -764,7 +764,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
764
764
|
if (!data || !data.compactionID) {
|
|
765
765
|
throw new Error(_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
766
766
|
}
|
|
767
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
767
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCompactionState', data, data.timeout || this.timeout)];
|
|
768
768
|
case 1:
|
|
769
769
|
res = _a.sent();
|
|
770
770
|
return [2 /*return*/, res];
|
|
@@ -804,7 +804,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
804
804
|
if (!data || !data.compactionID) {
|
|
805
805
|
throw new Error(_1.ERROR_REASONS.COMPACTIONID_IS_REQUIRED);
|
|
806
806
|
}
|
|
807
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
807
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetCompactionStateWithPlans', data, data.timeout || this.timeout)];
|
|
808
808
|
case 1:
|
|
809
809
|
res = _a.sent();
|
|
810
810
|
return [2 /*return*/, res];
|
|
@@ -861,7 +861,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
861
861
|
if (!data || !data.collectionID) {
|
|
862
862
|
throw new Error(_1.ERROR_REASONS.COLLECTION_ID_IS_REQUIRED);
|
|
863
863
|
}
|
|
864
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
864
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetReplicas', data, data.timeout || this.timeout)];
|
|
865
865
|
case 1:
|
|
866
866
|
res = _a.sent();
|
|
867
867
|
return [2 /*return*/, res];
|
|
@@ -904,7 +904,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
904
904
|
if (!data || !data.collection_name) {
|
|
905
905
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
906
906
|
}
|
|
907
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
907
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetLoadingProgress', data, data.timeout || this.timeout)];
|
|
908
908
|
case 1:
|
|
909
909
|
res = _a.sent();
|
|
910
910
|
return [2 /*return*/, res];
|
|
@@ -946,7 +946,7 @@ var Collection = /** @class */ (function (_super) {
|
|
|
946
946
|
if (!data || !data.collection_name) {
|
|
947
947
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
948
948
|
}
|
|
949
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
949
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetLoadState', data, data.timeout || this.timeout)];
|
|
950
950
|
case 1:
|
|
951
951
|
res = _a.sent();
|
|
952
952
|
return [2 /*return*/, res];
|
|
@@ -1 +1 @@
|
|
|
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,UAA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AAI,CAAC,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,MAAM,EACX,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
|
@@ -75,9 +75,11 @@ export declare class Data extends Collection {
|
|
|
75
75
|
* | collection_name | String | Collection name |
|
|
76
76
|
* | vectors or vector | Number[][] or Number[] | Original vector to search with |
|
|
77
77
|
* | partition_names(optional)| String[] | Array of partition names |
|
|
78
|
-
* | limit(optional) | number | topk |
|
|
78
|
+
* | limit(optional) | number | topk alias |
|
|
79
|
+
* | topk(optional) | number | topk |
|
|
79
80
|
* | offset(optional) | number | offset |
|
|
80
81
|
* | filter(optional) | String | Scalar field filter expression |
|
|
82
|
+
* | expr(optional) | String | filter alias |
|
|
81
83
|
* | output_fields(optional) | String[] | Support scalar field |
|
|
82
84
|
* | metric_type(optional) | String | similarity metric |
|
|
83
85
|
* | params(optional) | key value object | search params |
|
package/dist/milvus/Data.js
CHANGED
|
@@ -235,7 +235,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
235
235
|
_d),
|
|
236
236
|
_a;
|
|
237
237
|
});
|
|
238
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
238
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Insert', params, data.timeout || this.timeout)];
|
|
239
239
|
case 2:
|
|
240
240
|
promise = _a.sent();
|
|
241
241
|
return [2 /*return*/, promise];
|
|
@@ -280,7 +280,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
280
280
|
if (!data || !data.collection_name || !data.expr) {
|
|
281
281
|
throw new Error(_1.ERROR_REASONS.DELETE_PARAMS_CHECK);
|
|
282
282
|
}
|
|
283
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
283
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Delete', data, data.timeout || this.timeout)];
|
|
284
284
|
case 1:
|
|
285
285
|
promise = _a.sent();
|
|
286
286
|
return [2 /*return*/, promise];
|
|
@@ -297,9 +297,11 @@ var Data = /** @class */ (function (_super) {
|
|
|
297
297
|
* | collection_name | String | Collection name |
|
|
298
298
|
* | vectors or vector | Number[][] or Number[] | Original vector to search with |
|
|
299
299
|
* | partition_names(optional)| String[] | Array of partition names |
|
|
300
|
-
* | limit(optional) | number | topk |
|
|
300
|
+
* | limit(optional) | number | topk alias |
|
|
301
|
+
* | topk(optional) | number | topk |
|
|
301
302
|
* | offset(optional) | number | offset |
|
|
302
303
|
* | filter(optional) | String | Scalar field filter expression |
|
|
304
|
+
* | expr(optional) | String | filter alias |
|
|
303
305
|
* | output_fields(optional) | String[] | Support scalar field |
|
|
304
306
|
* | metric_type(optional) | String | similarity metric |
|
|
305
307
|
* | params(optional) | key value object | search params |
|
|
@@ -360,7 +362,9 @@ var Data = /** @class */ (function (_super) {
|
|
|
360
362
|
}
|
|
361
363
|
search_params = data.search_params || {
|
|
362
364
|
anns_field: anns_field,
|
|
363
|
-
topk: data.limit ||
|
|
365
|
+
topk: data.limit ||
|
|
366
|
+
data.topk ||
|
|
367
|
+
_1.DEFAULT_TOPK,
|
|
364
368
|
offset: data.offset || 0,
|
|
365
369
|
metric_type: data.metric_type || _1.DEFAULT_METRIC_TYPE,
|
|
366
370
|
params: JSON.stringify(data.params || {}),
|
|
@@ -383,7 +387,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
383
387
|
},
|
|
384
388
|
],
|
|
385
389
|
})).finish();
|
|
386
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
390
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Search', {
|
|
387
391
|
collection_name: data.collection_name,
|
|
388
392
|
partition_names: data.partition_names,
|
|
389
393
|
output_fields: data.output_fields || defaultOutputFields,
|
|
@@ -479,7 +483,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
479
483
|
!data.collection_names.length) {
|
|
480
484
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
481
485
|
}
|
|
482
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
486
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout || this.timeout)];
|
|
483
487
|
case 1:
|
|
484
488
|
res = _a.sent();
|
|
485
489
|
return [2 /*return*/, res];
|
|
@@ -522,7 +526,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
522
526
|
!data.collection_names.length) {
|
|
523
527
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
524
528
|
}
|
|
525
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
529
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout || this.timeout)];
|
|
526
530
|
case 1:
|
|
527
531
|
res = _a.sent();
|
|
528
532
|
segIDs = Object.keys(res.coll_segIDs)
|
|
@@ -592,7 +596,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
592
596
|
if (typeof data.offset === 'number') {
|
|
593
597
|
offset = { offset: data.offset };
|
|
594
598
|
}
|
|
595
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
599
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Query', __assign(__assign({}, data), { query_params: (0, utils_1.parseToKeyValue)(__assign(__assign({}, limits), offset)) }), data.timeout || this.timeout)];
|
|
596
600
|
case 1:
|
|
597
601
|
promise = _a.sent();
|
|
598
602
|
results = [];
|
|
@@ -666,7 +670,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
666
670
|
if (!data || !data.request || !data.request.metric_type) {
|
|
667
671
|
throw new Error(_1.ERROR_REASONS.GET_METRIC_CHECK_PARAMS);
|
|
668
672
|
}
|
|
669
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
673
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetMetrics', {
|
|
670
674
|
request: JSON.stringify(data.request),
|
|
671
675
|
}, data.timeout || this.timeout)];
|
|
672
676
|
case 1:
|
|
@@ -711,7 +715,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
711
715
|
if (!data || !data.segmentIDs) {
|
|
712
716
|
throw new Error(_1.ERROR_REASONS.GET_FLUSH_STATE_CHECK_PARAMS);
|
|
713
717
|
}
|
|
714
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
718
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetFlushState', data, data.timeout || this.timeout)];
|
|
715
719
|
case 1:
|
|
716
720
|
res = _a.sent();
|
|
717
721
|
return [2 /*return*/, res];
|
|
@@ -755,7 +759,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
755
759
|
if (!data || !data.src_nodeID) {
|
|
756
760
|
throw new Error(_1.ERROR_REASONS.LOAD_BALANCE_CHECK_PARAMS);
|
|
757
761
|
}
|
|
758
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
762
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadBalance', data, data.timeout || this.timeout)];
|
|
759
763
|
case 1:
|
|
760
764
|
res = _a.sent();
|
|
761
765
|
return [2 /*return*/, res];
|
|
@@ -797,7 +801,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
797
801
|
if (!data || !data.collectionName) {
|
|
798
802
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
799
803
|
}
|
|
800
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
804
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetQuerySegmentInfo', data, data.timeout || this.timeout)];
|
|
801
805
|
case 1:
|
|
802
806
|
res = _a.sent();
|
|
803
807
|
return [2 /*return*/, res];
|
|
@@ -844,7 +848,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
844
848
|
if (!data || !data.files) {
|
|
845
849
|
throw new Error(_1.ERROR_REASONS.IMPORT_FILE_CHECK);
|
|
846
850
|
}
|
|
847
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
851
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Import', __assign(__assign({}, data), { options: data.options || [] }), data.timeout || this.timeout)];
|
|
848
852
|
case 1:
|
|
849
853
|
res = _a.sent();
|
|
850
854
|
return [2 /*return*/, res];
|
|
@@ -891,7 +895,7 @@ var Data = /** @class */ (function (_super) {
|
|
|
891
895
|
if (!data || !data.collection_name) {
|
|
892
896
|
throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
|
|
893
897
|
}
|
|
894
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
898
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ListImportTasks', __assign(__assign({}, data), { limit: data.limit || 0 }), data.timeout || this.timeout)];
|
|
895
899
|
case 1:
|
|
896
900
|
res = _a.sent();
|
|
897
901
|
return [2 /*return*/, res];
|