@zilliz/milvus2-sdk-node 1.0.16 → 1.0.20

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.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/grpc-proto/common.proto +34 -0
  3. package/dist/grpc-proto/milvus.proto +357 -61
  4. package/dist/milvus/Client.d.ts +2 -0
  5. package/dist/milvus/Client.js +11 -0
  6. package/dist/milvus/Client.js.map +1 -1
  7. package/dist/milvus/Collection.d.ts +114 -4
  8. package/dist/milvus/Collection.js +267 -19
  9. package/dist/milvus/Collection.js.map +1 -1
  10. package/dist/milvus/Data.d.ts +150 -7
  11. package/dist/milvus/Data.js +341 -17
  12. package/dist/milvus/Data.js.map +1 -1
  13. package/dist/milvus/MilvusIndex.js +15 -3
  14. package/dist/milvus/MilvusIndex.js.map +1 -1
  15. package/dist/milvus/Partition.js +28 -7
  16. package/dist/milvus/Partition.js.map +1 -1
  17. package/dist/milvus/Utils.d.ts +1 -0
  18. package/dist/milvus/Utils.js +8 -0
  19. package/dist/milvus/Utils.js.map +1 -0
  20. package/dist/milvus/const/ErrorReason.d.ts +18 -3
  21. package/dist/milvus/const/ErrorReason.js +17 -2
  22. package/dist/milvus/const/ErrorReason.js.map +1 -1
  23. package/dist/milvus/index.js +4 -0
  24. package/dist/milvus/index.js.map +1 -1
  25. package/dist/milvus/types/Collection.d.ts +27 -10
  26. package/dist/milvus/types/Common.d.ts +13 -0
  27. package/dist/milvus/types/Common.js +16 -1
  28. package/dist/milvus/types/Common.js.map +1 -1
  29. package/dist/milvus/types/Data.d.ts +42 -0
  30. package/dist/milvus/types/{Insert.js → Data.js} +1 -1
  31. package/dist/milvus/types/Data.js.map +1 -0
  32. package/dist/milvus/types/Response.d.ts +52 -7
  33. package/dist/milvus/types/Response.js +1 -1
  34. package/dist/milvus/types/Response.js.map +1 -1
  35. package/dist/milvus/types/Search.d.ts +7 -0
  36. package/dist/milvus/types.d.ts +4 -4
  37. package/dist/milvus/utils/Format.d.ts +76 -0
  38. package/dist/milvus/utils/Format.js +126 -3
  39. package/dist/milvus/utils/Format.js.map +1 -1
  40. package/dist/milvus/utils/Validate.js +9 -1
  41. package/dist/milvus/utils/Validate.js.map +1 -1
  42. package/dist/sdk.json +1 -1
  43. package/dist/utils/index.d.ts +1 -0
  44. package/dist/utils/index.js +4 -2
  45. package/dist/utils/index.js.map +1 -1
  46. package/package.json +4 -3
  47. package/dist/milvus/types/Insert.d.ts +0 -18
  48. package/dist/milvus/types/Insert.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { Client } from "./Client";
2
2
  import { Collection } from "./Collection";
3
- import { FlushReq, InsertReq } from "./types/Insert";
4
- import { FlushResult, MutationResult, QueryResults, SearchResults } from "./types/Response";
5
- import { QueryReq, SearchReq } from "./types/Search";
3
+ import { CalcDistanceReq, DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, InsertReq, LoadBalanceReq } from "./types/Data";
4
+ import { CalcDistanceResponse, FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults } from "./types/Response";
5
+ import { GetMetricsRequest, QueryReq, SearchReq } from "./types/Search";
6
6
  export declare class Data extends Client {
7
7
  vectorTypes: number[];
8
8
  collectionManager: Collection;
@@ -40,6 +40,33 @@ export declare class Data extends Client {
40
40
  * ```
41
41
  */
42
42
  insert(data: InsertReq): Promise<MutationResult>;
43
+ /**
44
+ * Delete entities in Milvus
45
+ *
46
+ * @param data
47
+ * | Property | Type | Description |
48
+ * | :---------------------- | :-------------------- | :------------------------------- |
49
+ * | collection_name | String | Collection name |
50
+ * | partition_name(optional)| String | Partition name |
51
+ * | expr | String | Boolean expression used to filter attribute. |
52
+ *
53
+ * @return
54
+ * | Property | Description |
55
+ * | :-------------| :------------------------------- |
56
+ * | status | { error_code: number, reason: string }|
57
+ * | IDs | ID array of the successfully deleted data |
58
+ *
59
+ *
60
+ * #### Example
61
+ *
62
+ * ```
63
+ * new milvusClient(MILUVS_ADDRESS).dataManager.deleteEntities({
64
+ * collection_name: COLLECTION_NAME,
65
+ * expr: 'id in [1,2,3,4]'
66
+ * });
67
+ * ```
68
+ */
69
+ deleteEntities(data: DeleteEntitiesReq): Promise<MutationResult>;
43
70
  /**
44
71
  * Perform vector similarity search.
45
72
  *
@@ -53,14 +80,14 @@ export declare class Data extends Client {
53
80
  * | vectors | Number[][] | Original vector to search with |
54
81
  * | output_fields(optional) | String[] | Support scalar field |
55
82
  * | vector_type | enum | Binary field -> 100, Float field -> 101 |
83
+ * | travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search.|
56
84
 
57
85
  * @return
58
86
  * | Property | Description |
59
87
  * | :-------------| :------------------------------- |
60
88
  * | status | { error_code: number, reason: string }|
61
- * | succ_index | Insert successful index array |
62
- * | err_index | Insert failed index array |
63
- * | IDs | Insert successful id array |
89
+ * | results | {score:number,id:string}[]; |
90
+ *
64
91
  *
65
92
  *
66
93
  * #### Example
@@ -84,7 +111,7 @@ export declare class Data extends Client {
84
111
  search(data: SearchReq): Promise<SearchResults>;
85
112
  /**
86
113
  * Milvus temporarily buffers the newly inserted vectors in the cache. Call `flush()` to persist them to the object storage.
87
- *
114
+ * It's async function, so it's will take some times to excute.
88
115
  * @param data
89
116
  * | Property | Type | Description |
90
117
  * | :---------------------- | :---- | :------------------------------- |
@@ -104,6 +131,29 @@ export declare class Data extends Client {
104
131
  * ```
105
132
  */
106
133
  flush(data: FlushReq): Promise<FlushResult>;
134
+ /**
135
+ * It's same function as flush. But flushSync is sync function.
136
+ * So you can ensure it's flushed after function return the result.
137
+ *
138
+ * @param data
139
+ * | Property | Type | Description |
140
+ * | :---------------------- | :---- | :------------------------------- |
141
+ * | collection_names | String[] | Array of collection names |
142
+ *
143
+ * @return
144
+ * | Property | Description |
145
+ * | :-------------| :------------------------------- |
146
+ * | status | { error_code: number, reason: string }|
147
+ *
148
+ * #### Example
149
+ *
150
+ * ```
151
+ * new milvusClient(MILUVS_ADDRESS).dataManager.flushSync({
152
+ * collection_names: ['my_collection'],
153
+ * });
154
+ * ```
155
+ */
156
+ flushSync(data: FlushReq): Promise<FlushResult>;
107
157
  /**
108
158
  * Query vector data in Milvus. Current release of Milvus only supports expression as fieldname in [id1,id2,id3]
109
159
  *
@@ -135,4 +185,97 @@ export declare class Data extends Client {
135
185
  * ```
136
186
  */
137
187
  query(data: QueryReq): Promise<QueryResults>;
188
+ /**
189
+ * @ignore
190
+ * @param data
191
+ * | Property | Type | Description |
192
+ * | :------------------- | :---- | :---------------------------------------- |
193
+ * | request | object | Only allow "system_info" for now |
194
+ */
195
+ getMetric(data: GetMetricsRequest): Promise<GetMetricsResponse>;
196
+ /**
197
+ * @ignore
198
+ * @param data
199
+ */
200
+ calcDistance(data: CalcDistanceReq): Promise<CalcDistanceResponse>;
201
+ /**
202
+ * Get flush state by segment ids
203
+ *
204
+ * @param data
205
+ * | Property | Type | Description |
206
+ * | :---------------------- | :---- | :------------------------------- |
207
+ * | segmentIDs | Array | The segment ids |
208
+ *
209
+ *
210
+ *
211
+ * @return
212
+ * | Property | Description |
213
+ * | :-----------| :------------------------------- |
214
+ * | status | { error_code: number,reason:string } |
215
+ * | flushed | segments flushed or not |
216
+ *
217
+ *
218
+ * #### Example
219
+ *
220
+ * ```
221
+ * const res = await milvusClient.dataManager.getFlushState({
222
+ * segmentIDs: segIds,
223
+ * });
224
+ * ```
225
+ */
226
+ getFlushState(data: GetFlushStateReq): Promise<GetFlushStateResponse>;
227
+ /**
228
+ * Do load balancing operation from source query node to destination query node.
229
+ * Only work in cluster milvus.
230
+ *
231
+ * @param data
232
+ * | Property | Type | Description |
233
+ * | :-------------------| :---- | :------------------------------- |
234
+ * | src_nodeID | number | The source query node id to balance. |
235
+ * | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
236
+ * | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
237
+ *
238
+ *
239
+ * @return
240
+ * | Property | Description |
241
+ * | :-----------| :------------------------------- |
242
+ * | status | { error_code: number,reason:string } |
243
+ * | infos | segments infomations |
244
+ *
245
+ *
246
+ * #### Example
247
+ *
248
+ * ```
249
+ * const res = await dataManager.loadBalance({
250
+ * src_nodeID: 31,
251
+ * });
252
+ * ```
253
+ */
254
+ loadBalance(data: LoadBalanceReq): Promise<ResStatus>;
255
+ /**
256
+ * Notifies Proxy to return segments information from query nodes.
257
+ *
258
+ * @param data
259
+ * | Property | Type | Description |
260
+ * | :---------------------- | :---- | :------------------------------- |
261
+ * | collectionName | String | The name of the collection to get segments info. |
262
+ *
263
+ *
264
+ *
265
+ * @return
266
+ * | Property | Description |
267
+ * | :-----------| :------------------------------- |
268
+ * | status | { error_code: number,reason:string } |
269
+ * | infos | QuerySegmentInfo is the growing segments's information in query cluster. |
270
+ *
271
+ *
272
+ * #### Example
273
+ *
274
+ * ```
275
+ * const res = await dataManager.getQuerySegmentInfo({
276
+ * collectionName: COLLECTION,
277
+ * });
278
+ * ```
279
+ */
280
+ getQuerySegmentInfo(data: GetQuerySegmentInfoReq): Promise<GetQuerySegmentInfoResponse>;
138
281
  }