@zilliz/milvus2-sdk-node 2.3.4 → 2.4.0

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 (122) hide show
  1. package/README.md +154 -35
  2. package/dist/milvus/HttpClient.d.ts +165 -2
  3. package/dist/milvus/HttpClient.js +17 -3
  4. package/dist/milvus/HttpClient.js.map +1 -1
  5. package/dist/milvus/MilvusClient.d.ts +3 -3
  6. package/dist/milvus/MilvusClient.js +42 -8
  7. package/dist/milvus/MilvusClient.js.map +1 -1
  8. package/dist/milvus/const/client.d.ts +4 -3
  9. package/dist/milvus/const/client.js +4 -3
  10. package/dist/milvus/const/client.js.map +1 -1
  11. package/dist/milvus/const/defaults.d.ts +5 -4
  12. package/dist/milvus/const/defaults.js +14 -13
  13. package/dist/milvus/const/defaults.js.map +1 -1
  14. package/dist/milvus/const/error.js +1 -1
  15. package/dist/milvus/const/error.js.map +1 -1
  16. package/dist/milvus/const/milvus.d.ts +45 -8
  17. package/dist/milvus/const/milvus.js +41 -3
  18. package/dist/milvus/const/milvus.js.map +1 -1
  19. package/dist/milvus/grpc/BaseClient.d.ts +11 -9
  20. package/dist/milvus/grpc/BaseClient.js +59 -21
  21. package/dist/milvus/grpc/BaseClient.js.map +1 -1
  22. package/dist/milvus/grpc/Collection.d.ts +311 -366
  23. package/dist/milvus/grpc/Collection.js +355 -387
  24. package/dist/milvus/grpc/Collection.js.map +1 -1
  25. package/dist/milvus/grpc/Data.d.ts +244 -291
  26. package/dist/milvus/grpc/Data.js +402 -539
  27. package/dist/milvus/grpc/Data.js.map +1 -1
  28. package/dist/milvus/grpc/Database.d.ts +29 -41
  29. package/dist/milvus/grpc/Database.js +32 -44
  30. package/dist/milvus/grpc/Database.js.map +1 -1
  31. package/dist/milvus/grpc/GrpcClient.d.ts +34 -13
  32. package/dist/milvus/grpc/GrpcClient.js +80 -70
  33. package/dist/milvus/grpc/GrpcClient.js.map +1 -1
  34. package/dist/milvus/grpc/MilvusIndex.d.ts +127 -67
  35. package/dist/milvus/grpc/MilvusIndex.js +166 -70
  36. package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
  37. package/dist/milvus/grpc/Partition.d.ts +78 -113
  38. package/dist/milvus/grpc/Partition.js +109 -119
  39. package/dist/milvus/grpc/Partition.js.map +1 -1
  40. package/dist/milvus/grpc/Resource.d.ts +63 -92
  41. package/dist/milvus/grpc/Resource.js +69 -98
  42. package/dist/milvus/grpc/Resource.js.map +1 -1
  43. package/dist/milvus/grpc/User.d.ts +263 -295
  44. package/dist/milvus/grpc/User.js +287 -310
  45. package/dist/milvus/grpc/User.js.map +1 -1
  46. package/dist/milvus/http/Alias.d.ts +37 -0
  47. package/dist/milvus/http/Alias.js +62 -0
  48. package/dist/milvus/http/Alias.js.map +1 -0
  49. package/dist/milvus/http/Collection.d.ts +15 -1
  50. package/dist/milvus/http/Collection.js +55 -9
  51. package/dist/milvus/http/Collection.js.map +1 -1
  52. package/dist/milvus/http/Import.d.ts +33 -0
  53. package/dist/milvus/http/Import.js +48 -0
  54. package/dist/milvus/http/Import.js.map +1 -0
  55. package/dist/milvus/http/MilvusIndex.d.ts +35 -0
  56. package/dist/milvus/http/MilvusIndex.js +55 -0
  57. package/dist/milvus/http/MilvusIndex.js.map +1 -0
  58. package/dist/milvus/http/Partition.d.ts +41 -0
  59. package/dist/milvus/http/Partition.js +76 -0
  60. package/dist/milvus/http/Partition.js.map +1 -0
  61. package/dist/milvus/http/Role.d.ts +39 -0
  62. package/dist/milvus/http/Role.js +69 -0
  63. package/dist/milvus/http/Role.js.map +1 -0
  64. package/dist/milvus/http/User.d.ts +41 -0
  65. package/dist/milvus/http/User.js +76 -0
  66. package/dist/milvus/http/User.js.map +1 -0
  67. package/dist/milvus/http/Vector.d.ts +5 -3
  68. package/dist/milvus/http/Vector.js +10 -7
  69. package/dist/milvus/http/Vector.js.map +1 -1
  70. package/dist/milvus/http/index.d.ts +6 -0
  71. package/dist/milvus/http/index.js +6 -0
  72. package/dist/milvus/http/index.js.map +1 -1
  73. package/dist/milvus/index.d.ts +0 -1
  74. package/dist/milvus/index.js +0 -1
  75. package/dist/milvus/index.js.map +1 -1
  76. package/dist/milvus/types/Client.d.ts +5 -0
  77. package/dist/milvus/types/Collection.d.ts +34 -9
  78. package/dist/milvus/types/Common.d.ts +1 -3
  79. package/dist/milvus/types/Data.d.ts +79 -23
  80. package/dist/milvus/types/Data.js +1 -0
  81. package/dist/milvus/types/Data.js.map +1 -1
  82. package/dist/milvus/types/HighLevel.d.ts +6 -3
  83. package/dist/milvus/types/Http.d.ts +191 -9
  84. package/dist/milvus/types/MilvusIndex.d.ts +17 -3
  85. package/dist/milvus/types/User.d.ts +10 -9
  86. package/dist/milvus/utils/Bytes.d.ts +84 -0
  87. package/dist/milvus/utils/Bytes.js +261 -0
  88. package/dist/milvus/utils/Bytes.js.map +1 -0
  89. package/dist/milvus/utils/Format.d.ts +126 -68
  90. package/dist/milvus/utils/Format.js +375 -94
  91. package/dist/milvus/utils/Format.js.map +1 -1
  92. package/dist/milvus/utils/Function.d.ts +4 -2
  93. package/dist/milvus/utils/Function.js +58 -25
  94. package/dist/milvus/utils/Function.js.map +1 -1
  95. package/dist/milvus/utils/Grpc.d.ts +3 -2
  96. package/dist/milvus/utils/Grpc.js +65 -98
  97. package/dist/milvus/utils/Grpc.js.map +1 -1
  98. package/dist/milvus/utils/Validate.d.ts +18 -3
  99. package/dist/milvus/utils/Validate.js +38 -12
  100. package/dist/milvus/utils/Validate.js.map +1 -1
  101. package/dist/milvus/utils/index.d.ts +1 -1
  102. package/dist/milvus/utils/index.js +1 -1
  103. package/dist/milvus/utils/index.js.map +1 -1
  104. package/dist/proto/proto/common.proto +29 -1
  105. package/dist/proto/proto/google/protobuf/descriptor.proto +96 -34
  106. package/dist/proto/proto/milvus.proto +168 -2
  107. package/dist/proto/proto/rg.proto +28 -0
  108. package/dist/proto/proto/schema.proto +36 -0
  109. package/dist/sdk.json +1 -1
  110. package/package.json +8 -5
  111. package/dist/milvus/OrmClient.d.ts +0 -19
  112. package/dist/milvus/OrmClient.js +0 -51
  113. package/dist/milvus/OrmClient.js.map +0 -1
  114. package/dist/milvus/orm/Collection.d.ts +0 -43
  115. package/dist/milvus/orm/Collection.js +0 -165
  116. package/dist/milvus/orm/Collection.js.map +0 -1
  117. package/dist/milvus/orm/index.d.ts +0 -1
  118. package/dist/milvus/orm/index.js +0 -18
  119. package/dist/milvus/orm/index.js.map +0 -1
  120. package/dist/milvus/utils/Blob.d.ts +0 -4
  121. package/dist/milvus/utils/Blob.js +0 -18
  122. package/dist/milvus/utils/Blob.js.map +0 -1
@@ -1,7 +1,6 @@
1
- import { DataType, DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, GePersistentSegmentInfoReq, InsertReq, LoadBalanceReq, ImportReq, ListImportTasksReq, FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, GePersistentSegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults, ImportResponse, ListImportTasksResponse, GetMetricsRequest, QueryReq, GetReq, DeleteReq, SearchReq, SearchSimpleReq, CountReq, CountResult } from '../';
1
+ import { DeleteEntitiesReq, FlushReq, GetFlushStateReq, GetQuerySegmentInfoReq, GePersistentSegmentInfoReq, InsertReq, LoadBalanceReq, ImportReq, ListImportTasksReq, FlushResult, GetFlushStateResponse, GetMetricsResponse, GetQuerySegmentInfoResponse, GePersistentSegmentInfoResponse, MutationResult, QueryResults, ResStatus, SearchResults, ImportResponse, ListImportTasksResponse, GetMetricsRequest, QueryReq, GetReq, DeleteReq, SearchReq, SearchSimpleReq, HybridSearchReq, CountReq, CountResult } from '../';
2
2
  import { Collection } from './Collection';
3
3
  export declare class Data extends Collection {
4
- vectorTypes: DataType[];
5
4
  /**
6
5
  * Upsert data into Milvus, view _insert for detail
7
6
  */
@@ -11,31 +10,27 @@ export declare class Data extends Collection {
11
10
  */
12
11
  insert(data: InsertReq): Promise<MutationResult>;
13
12
  /**
14
- * Insert/upsert data into Milvus.
15
- *
16
- * @param data
17
- * | Property | Type | Description |
18
- * | :--- | :-- | :-- |
19
- * | collection_name | String | Collection name |
20
- * | partition_name(optional)| String | Partition name |
21
- * | fields_data or data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
22
- * | 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 |
23
-
24
- *
25
- * @returns
26
- * | Property | Description |
27
- * | :-- | :-- |
28
- * | status | { error_code: number, reason: string } |
29
- * | succ_index | Index array of the successfully inserted data |
30
- * | err_index | Index array of the unsuccessfully inserted data |
31
- * | IDs | ID array of the successfully inserted data |
32
- *
33
- *
34
- * #### Example
35
- *
13
+ * Insert or upsert data into a Milvus collection.
14
+ *
15
+ * @param {InsertReq} data - The request parameters.
16
+ * @param {string} data.collection_name - The name of the collection.
17
+ * @param {string} [data.partition_name] - The name of the partition (optional).
18
+ * @param {{ [x: string]: any }[]} data.data - The data to be inserted. If the field type is binary, the vector data length needs to be dimension / 8.
19
+ * @param {InsertTransformers} data.transformers - The transformers for bf16 or f16 data, it accept an f32 array, it should output f16 or bf16 bytes (optional)
20
+ * @param {number} [data.timeout] - 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 error occurs. Default is undefined.
21
+ *
22
+ * @returns {Promise<MutationResult>} The result of the operation.
23
+ * @returns {string} status.error_code - The error code of the operation.
24
+ * @returns {string} status.reason - The reason for the error, if any.
25
+ * @returns {number[]} succ_index - Index array of the successfully inserted data.
26
+ * @returns {number[]} err_index - Index array of the unsuccessfully inserted data.
27
+ * @returns {number[]} IDs - ID array of the successfully inserted data.
28
+ *
29
+ * @example
36
30
  * ```
37
- * new milvusClient(MILUVS_ADDRESS).insert({
38
- * collection_name: COLLECTION_NAME,
31
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
32
+ * const resStatus = await milvusClient.insert({
33
+ * collection_name: 'my_collection',
39
34
  * fields_data: [{
40
35
  * vector_field: [1,2,2,4],
41
36
  * scalar_field: 1
@@ -45,173 +40,162 @@ export declare class Data extends Collection {
45
40
  */
46
41
  private _insert;
47
42
  /**
48
- * Delete entities in Milvus
49
- *
50
- * @param data
51
- * | Property | Type | Description |
52
- * | :--- | :-- | :-- |
53
- * | collection_name | String | Collection name |
54
- * | partition_name(optional)| String | Partition name |
55
- * | expr or filter | String | Boolean expression used to filter attribute. |
56
- * | 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 |
57
-
43
+ * Delete entities in a Milvus collection.
58
44
  *
59
- * @returns
60
- * | Property | Description |
61
- * | :-- | :-- |
62
- * | status | { error_code: number, reason: string } |
63
- * | IDs | ID array of the successfully deleted data |
45
+ * @param {DeleteEntitiesReq} data - The request parameters.
46
+ * @param {string} data.collection_name - The name of the collection.
47
+ * @param {string} [data.partition_name] - The name of the partition (optional).
48
+ * @param {string} data.expr - Boolean expression used to filter entities for deletion.
49
+ * @param {number} [data.timeout] - 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 error occurs. Default is undefined.
64
50
  *
51
+ * @returns {Promise<MutationResult>} The result of the operation.
52
+ * @returns {string} status.error_code - The error code of the operation.
53
+ * @returns {string} status.reason - The reason for the error, if any.
54
+ * @returns {number[]} IDs - ID array of the successfully deleted data.
65
55
  *
66
- * #### Example
67
- *
56
+ * @example
68
57
  * ```
69
- * new milvusClient(MILUVS_ADDRESS).deleteEntities({
70
- * collection_name: COLLECTION_NAME,
58
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
59
+ * const resStatus = await milvusClient.deleteEntities({
60
+ * collection_name: 'my_collection',
71
61
  * expr: 'id in [1,2,3,4]'
72
62
  * });
73
63
  * ```
74
64
  */
75
65
  deleteEntities(data: DeleteEntitiesReq): Promise<MutationResult>;
76
66
  /**
77
- * Delete entities in Milvus
78
- *
79
- * @param data
80
- * | Property | Type | Description |
81
- * | :--- | :-- | :-- |
82
- * | collection_name | String | Collection name |
83
- * | partition_name(optional)| String | Partition name |
84
- * | ids | String[] or Number[] | ids to delete |
85
- * | 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 |
86
-
87
- *
88
- * @returns
89
- * | Property | Description |
90
- * | :-- | :-- |
91
- * | status | { error_code: number, reason: string } |
92
- * | IDs | ID array of the successfully deleted data |
93
- *
94
- *
95
- * #### Example
67
+ * Delete entities in a Milvus collection.
68
+ *
69
+ * @param {DeleteReq} data - The request parameters.
70
+ * @param {string} data.collection_name - The name of the collection.
71
+ * @param {string} [data.partition_name] - The name of the partition (optional).
72
+ * @param {(string[] | number[])} [data.ids] - IDs of the entities to delete.
73
+ * @param {string} [data.filter] - Filter expression, takes precedence over ids.
74
+ * @param {string} [data.expr] - equals to data.filter.
75
+ * @param {number} [data.timeout] - Optional duration of time in milliseconds to allow for the RPC. If undefined, the client keeps waiting until the server responds or an error occurs. Default is undefined.
76
+ *
77
+ * @returns {Promise<MutationResult>} The result of the operation.
78
+ * @returns {string} status.error_code - The error code of the operation.
79
+ * @returns {string} status.reason - The reason for the error, if any.
80
+ * @returns {number[]} IDs - Array of IDs of the successfully deleted entities.
81
+ *
82
+ * @example
83
+ * ```
84
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
85
+ * const resStatus = await milvusClient.delete({
86
+ * collection_name: 'my_collection',
87
+ * filter: 'id in [1,2,3,4]'
88
+ * });
89
+ * ```
96
90
  *
97
91
  * ```
98
- * new milvusClient(MILUVS_ADDRESS).deleteEntities({
99
- * collection_name: COLLECTION_NAME,
100
- * expr: 'id in [1,2,3,4]'
92
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
93
+ * const resStatus = await milvusClient.delete({
94
+ * collection_name: 'my_collection',
95
+ * ids: [1,2,3,4]
101
96
  * });
102
97
  * ```
103
98
  */
104
99
  delete(data: DeleteReq): Promise<MutationResult>;
105
100
  /**
106
- * Perform vector similarity search.
107
- *
108
- * @param data
109
- * | Property | Type | Description |
110
- * | :--- | :-- | :-- |
111
- * | collection_name | String | Collection name |
112
- * | vectors or data or (vector) | Number[][] or Number[] | Original vector to search with |
113
- * | partition_names(optional)| String[] | Array of partition names |
114
- * | limit(optional) | number | topk alias |
115
- * | topk(optional) | number | topk |
116
- * | offset(optional) | number | offset |
117
- * | filter(optional) | String | Scalar field filter expression |
118
- * | expr(optional) | String | filter alias |
119
- * | output_fields(optional) | String[] | Support scalar field |
120
- * | metric_type(optional) | String | similarity metric |
121
- * | params(optional) | key value object | search params |
122
- *
123
- * @returns
124
- * | Property | Description |
125
- * | :-- | :-- |
126
- * | status | { error_code: number, reason: string } |∂
127
- * | results | {score:number,id:string}[]; |
128
- *
129
- * #### Example
130
- *
101
+ * Perform vector similarity search in a Milvus collection.
102
+ *
103
+ * @param {SearchReq | SearchSimpleReq} data - The request parameters.
104
+ * @param {string} data.collection_name - The name of the collection.
105
+ * @param {Number[]} data.vector - Original vector to search with.
106
+ * @param {string[]} [data.partition_names] - Array of partition names (optional).
107
+ * @param {number} [data.topk] - Topk (optional).
108
+ * @param {number} [data.limit] - Alias for topk (optional).
109
+ * @param {number} [data.offset] - Offset (optional).
110
+ * @param {string} [data.filter] - Scalar field filter expression (optional).
111
+ * @param {string[]} [data.output_fields] - Support scalar field (optional).
112
+ * @param {object} [data.params] - Search params (optional).
113
+ * @param {OutputTransformers} data.transformers - The transformers for bf16 or f16 data, it accept bytes or sparse dic vector, it can ouput f32 array or other format(optional)
114
+ * @param {number} [data.timeout] - 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 error occurs. Default is undefined.
115
+ *
116
+ * @returns {Promise<SearchResults>} The result of the operation.
117
+ * @returns {string} status.error_code - The error code of the operation.
118
+ * @returns {string} status.reason - The reason for the error, if any.
119
+ * @returns {{score:number,id:string, [outputfield]: value}[]} results - Array of search results.
120
+ *
121
+ * @example
131
122
  * ```
132
- * new milvusClient(MILUVS_ADDRESS).search({
133
- * collection_name: COLLECTION_NAME,
134
- * vector: [1, 2, 3, 4],
123
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
124
+ * const searchResults = await milvusClient.search({
125
+ * collection_name: 'my_collection',
126
+ * vector: [1, 2, 3, 4],
135
127
  * });
136
128
  * ```
137
129
  */
138
- search(data: SearchReq | SearchSimpleReq): Promise<SearchResults>;
130
+ search(data: SearchReq | SearchSimpleReq | HybridSearchReq): Promise<SearchResults>;
131
+ hybridSearch: (data: SearchReq | SearchSimpleReq | HybridSearchReq) => Promise<SearchResults>;
139
132
  /**
140
- * Milvus temporarily buffers the newly inserted vectors in the cache. Call `flush()` to persist them to the object storage.
141
- * It's async function, so it's will take some times to execute.
142
- * @param data
143
- * | Property | Type | Description |
144
- * | :--- | :-- | :-- |
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 |
147
-
133
+ * Flushes the newly inserted vectors that are temporarily buffered in the cache to the object storage.
134
+ * This is an asynchronous function and may take some time to execute deponds on your data size.
148
135
  *
149
- * @returns
150
- * | Property | Description |
151
- * | :-- | :-- |
152
- * | status | { error_code: number, reason: string } |
136
+ * @param {FlushReq} data - The request parameters.
137
+ * @param {string[]} data.collection_names - Array of collection names.
138
+ * @param {number} [data.timeout] - 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 error occurs. Default is undefined.
153
139
  *
154
- * #### Example
140
+ * @returns {Promise<FlushResult>} The result of the operation.
141
+ * @returns {string} status.error_code - The error code of the operation.
142
+ * @returns {string} status.reason - The reason for the error, if any.
155
143
  *
144
+ * @example
156
145
  * ```
157
- * new milvusClient(MILUVS_ADDRESS).flush({
158
- * collection_names: ['my_collection'],
146
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
147
+ * const flushStatus = await milvusClient.flush({
148
+ * collection_names: ['my_collection'],
159
149
  * });
160
150
  * ```
161
151
  */
162
152
  flush(data: FlushReq): Promise<FlushResult>;
163
153
  /**
164
- * It's same function as flush. But flushSync is sync function.
165
- * So you can ensure it's flushed after function return the result.
154
+ * This function is similar to the `flush` function, but it is synchronous.
155
+ * This ensures that the flush operation is completed before the function returns.
166
156
  *
167
- * @param data
168
- * | Property | Type | Description |
169
- * | :--- | :-- | :-- |
170
- * | collection_names | String[] | Array of collection names |
171
- * | 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 |
172
-
157
+ * @param {FlushReq} data - The request parameters.
158
+ * @param {string[]} data.collection_names - Array of collection names.
159
+ * @param {number} [data.timeout] - 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 error occurs. Default is undefined.
173
160
  *
174
- * @returns
175
- * | Property | Description |
176
- * | :-- | :-- |
177
- * | status | { error_code: number, reason: string } |
178
- *
179
- * #### Example
161
+ * @returns {Promise<GetFlushStateResponse>} The result of the operation.
162
+ * @returns {string} status.error_code - The error code of the operation.
163
+ * @returns {string} status.reason - The reason for the error, if any.
180
164
  *
165
+ * @example
181
166
  * ```
182
- * new milvusClient(MILUVS_ADDRESS).flushSync({
183
- * collection_names: ['my_collection'],
167
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
168
+ * const flushSyncStatus = await milvusClient.flushSync({
169
+ * collection_names: ['my_collection'],
184
170
  * });
185
171
  * ```
186
172
  */
187
173
  flushSync(data: FlushReq): Promise<GetFlushStateResponse>;
188
174
  /**
189
- * Query vector data in Milvus. Current release of Milvus only supports expression as fieldname in [id1,id2,id3]
190
- *
191
- * @param data
192
- * | Property | Type | Description |
193
- * | :--- | :-- | :-- |
194
- * | collection_name | String | Collection name |
195
- * | expr or filter | String | Scalar field filter expression |
196
- * | partitions_names(optional) | String[] | Array of partition names |
197
- * | output_fields | String[] | Vector or scalar field to be returned |
198
- * | 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 |
199
-
200
- * | params | {key: value}[] | An optional key pair json array
201
- *
202
- * @returns
203
- * | Property | Description |
204
- * | :-- | :-- |
205
- * | status | { error_code: number,reason:string } |
206
- * | data | Data of all fields that you defined in `output_fields`, {field_name: value}[] |
207
- *
208
- *
209
- * #### Example
210
- *
175
+ * Query vector data in Milvus. Current release of Milvus only supports expression as fieldname in [id1,id2,id3].
176
+ *
177
+ * @param {QueryReq} data - The request parameters.
178
+ * @param {string} data.collection_name - Collection name.
179
+ * @param {string[]} [data.ids] - IDs to get.
180
+ * @param {string} [data.expr] - Scalar field filter expression.
181
+ * @param {string} [data.filter] - Equals to data.expr.
182
+ * @param {string[]} [data.partitions_names] - Array of partition names (optional).
183
+ * @param {string[]} data.output_fields - Vector or scalar field to be returned.
184
+ * @param {number} [data.timeout] - 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.
185
+ * @param {{key: value}[]} [data.params] - An optional key pair json array of search parameters.
186
+ * @param {OutputTransformers} data.transformers - The transformers for bf16 or f16 data, it accept bytes or sparse dic vector, it can ouput f32 array or other format(optional)
187
+ *
188
+ * @returns {Promise<QueryResults>} The result of the operation.
189
+ * @returns {string} status.error_code - The error code of the operation.
190
+ * @returns {string} status.reason - The reason for the error, if any.
191
+ * @returns {{field_name: value}[]} data - Data of all fields that you defined in `output_fields`.
192
+ *
193
+ * @example
211
194
  * ```
212
- * new milvusClient(MILUVS_ADDRESS).query({
195
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
196
+ * const queryResults = await milvusClient.query({
213
197
  * collection_name: 'my_collection',
214
- * expr: "age in [1,2,3,4,5,6,7,8]",
198
+ * filter: "age in [1,2,3,4,5,6,7,8]",
215
199
  * output_fields: ["age"],
216
200
  * });
217
201
  * ```
@@ -219,32 +203,27 @@ export declare class Data extends Collection {
219
203
  query(data: QueryReq): Promise<QueryResults>;
220
204
  count(data: CountReq): Promise<CountResult>;
221
205
  /**
222
- * get vector data by providing ids in Milvus
223
- *
224
- * @param data
225
- * | Property | Type | Description |
226
- * | :--- | :-- | :-- |
227
- * | collection_name | String | Collection name |
228
- * | ids | String[] | ids to get |
229
- * | partitions_names(optional) | String[] | Array of partition names |
230
- * | output_fields | String[] | Vector or scalar field to be returned |
231
- * | 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 |
232
-
233
- * | params | {key: value}[] | An optional key pair json array
234
- *
235
- * @returns
236
- * | Property | Description |
237
- * | :-- | :-- |
238
- * | status | { error_code: number,reason:string } |
239
- * | data | Data of all fields that you defined in `output_fields`, {field_name: value}[] |
240
- *
241
- *
242
- * #### Example
243
- *
206
+ * Retrieve vector data by providing IDs in Milvus.
207
+ *
208
+ * @param {GetReq} data - The request parameters.
209
+ * @param {string} data.collection_name - Collection name.
210
+ * @param {string[]} data.ids - IDs to get.
211
+ * @param {string[]} [data.partitions_names] - Array of partition names (optional).
212
+ * @param {string[]} data.output_fields - Vector or scalar field to be returned.
213
+ * @param {number} [data.timeout] - 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.
214
+ * @param {{key: value}[]} [data.params] - An optional key pair json array.
215
+ *
216
+ * @returns {Promise<QueryResults>} The result of the operation.
217
+ * @returns {string} status.error_code - The error code of the operation.
218
+ * @returns {string} status.reason - The reason for the error, if any.
219
+ * @returns {{field_name: value}[]} data - Data of all fields that you defined in `output_fields`.
220
+ *
221
+ * @example
244
222
  * ```
245
- * new milvusClient(MILUVS_ADDRESS).get({
223
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
224
+ * const getResults = await milvusClient.get({
246
225
  * collection_name: 'my_collection',
247
- * ids: [1,2,3,4,5,6,7,8],
226
+ * ids: ['1','2','3','4','5','6','7','8'],
248
227
  * output_fields: ["age"],
249
228
  * });
250
229
  * ```
@@ -259,164 +238,138 @@ export declare class Data extends Collection {
259
238
  */
260
239
  getMetric(data: GetMetricsRequest): Promise<GetMetricsResponse>;
261
240
  /**
262
- * Get flush state by segment ids
241
+ * Get the flush state of specified segment IDs in Milvus.
263
242
  *
264
- * @param data
265
- * | Property | Type | Description |
266
- * | :--- | :-- | :-- |
267
- * | segmentIDs | Array | The segment ids |
268
- * | 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 |
269
- *
270
- * @returns
271
- * | Property | Description |
272
- * | :--- | :-- |
273
- * | status | { error_code: number,reason:string } |
274
- * | flushed | segments flushed or not |
243
+ * @param {GetFlushStateReq} data - The request parameters.
244
+ * @param {number[]} data.segmentIDs - The segment IDs.
245
+ * @param {number} [data.timeout] - 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.
275
246
  *
247
+ * @returns {Promise<GetFlushStateResponse>} The result of the operation.
248
+ * @returns {string} status.error_code - The error code of the operation.
249
+ * @returns {string} status.reason - The reason for the error, if any.
250
+ * @returns {boolean[]} flushed - Array indicating whether each segment is flushed or not.
276
251
  *
277
- * #### Example
278
- *
252
+ * @example
279
253
  * ```
280
- * const res = await milvusClient.getFlushState({
281
- * segmentIDs: segIds,
282
- * });
254
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
255
+ * const flushState = await milvusClient.getFlushState({
256
+ * segmentIDs: [1,2,3,4],
257
+ * });
283
258
  * ```
284
259
  */
285
260
  getFlushState(data: GetFlushStateReq): Promise<GetFlushStateResponse>;
286
261
  /**
287
- * Do load balancing operation from source query node to destination query node.
288
- * Only work in cluster milvus.
262
+ * Perform a load balancing operation from a source query node to destination query nodes.
263
+ * This function only works in a Milvus cluster.
289
264
  *
290
- * @param data
291
- * | Property | Type | Description |
292
- * | :--- | :-- | :-- |
293
- * | src_nodeID | number | The source query node id to balance. |
294
- * | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
295
- * | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
296
- * | 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 |
297
- *
298
- * @returns
299
- * | Property | Description |
300
- * | :--- | :-- |
301
- * | status | { error_code: number,reason:string } |
302
- * | infos | segments information |
265
+ * @param {LoadBalanceReq} data - The request parameters.
266
+ * @param {number} data.src_nodeID - The source query node id to balance.
267
+ * @param {number[]} [data.dst_nodeIDs] - The destination query node ids to balance (optional).
268
+ * @param {number[]} [data.sealed_segmentIDs] - Sealed segment ids to balance (optional).
269
+ * @param {number} [data.timeout] - 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.
303
270
  *
271
+ * @returns {Promise<ResStatus>} The result of the operation.
272
+ * @returns {string} status.error_code - The error code of the operation.
273
+ * @returns {string} status.reason - The reason for the error, if any.
274
+ * @returns {SegmentInfo[]} infos - Information about the segments.
304
275
  *
305
- * #### Example
306
- *
276
+ * @example
307
277
  * ```
308
- * const res = await loadBalance({
309
- * src_nodeID: 31,
310
- * });
278
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
279
+ * const loadBalanceStatus = await milvusClient.loadBalance({
280
+ * src_nodeID: 31,
281
+ * });
311
282
  * ```
312
283
  */
313
284
  loadBalance(data: LoadBalanceReq): Promise<ResStatus>;
314
285
  /**
315
286
  * Notifies Proxy to return segments information from query nodes.
316
287
  *
317
- * @param data
318
- * | Property | Type | Description |
319
- * | :--- | :-- | :-- |
320
- * | collectionName | String | The name of the collection to get segments info. |
321
- * | 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 |
322
- *
323
- *
324
- * @returns
325
- * | Property | Description |
326
- * | :--- | :-- |
327
- * | status | { error_code: number,reason:string } |
328
- * | infos | QuerySegmentInfo is the growing segments's information in query cluster. |
288
+ * @param {GetQuerySegmentInfoReq} data - The request parameters.
289
+ * @param {string} data.collectionName - The name of the collection to get segments info.
290
+ * @param {number} [data.timeout] - 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.
329
291
  *
292
+ * @returns {Promise<GetQuerySegmentInfoResponse>} The result of the operation.
293
+ * @returns {string} status.error_code - The error code of the operation.
294
+ * @returns {string} status.reason - The reason for the error, if any.
295
+ * @returns {QuerySegmentInfo[]} infos - The growing segments' information in query cluster.
330
296
  *
331
- * #### Example
332
- *
297
+ * @example
333
298
  * ```
334
- * const res = await getQuerySegmentInfo({
335
- * collectionName: COLLECTION,
336
- * });
299
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
300
+ * const querySegmentInfo = await milvusClient.getQuerySegmentInfo({
301
+ * collectionName: 'my_collection',
302
+ * });
337
303
  * ```
338
304
  */
339
305
  getQuerySegmentInfo(data: GetQuerySegmentInfoReq): Promise<GetQuerySegmentInfoResponse>;
340
- /**data
306
+ /**
341
307
  * Notifies Proxy to return segments information from data nodes.
342
308
  *
343
- * @param data
344
- * | Property | Type | Description |
345
- * | :--- | :-- | :-- |
346
- * | collectionName | String | The name of the collection to get segments info. |
347
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
348
- *
309
+ * @param {GetPersistentSegmentInfoReq} data - The request parameters.
310
+ * @param {string} data.collectionName - The name of the collection to get segments info.
311
+ * @param {number} [data.timeout] - An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
349
312
  *
350
- * @returns
351
- * | Property | Description |
352
- * | :--- | :-- |
353
- * | status | { error_code: number,reason:string } |
354
- * | infos | getPersistentSegmentInfo is the growing segments's information in query cluster. |
355
- *
356
- *
357
- * #### Example
313
+ * @returns {Promise<GetPersistentSegmentInfoResponse>} The result of the operation.
314
+ * @returns {string} status.error_code - The error code of the operation.
315
+ * @returns {string} status.reason - The reason for the error, if any.
316
+ * @returns {PersistentSegmentInfo[]} infos - The growing segments' information in data cluster.
358
317
  *
318
+ * @example
359
319
  * ```
360
- * const res = await getPersistentSegmentInfo({
361
- * collectionName: COLLECTION,
362
- * });
320
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
321
+ * const persistentSegmentInfo = await milvusClient.getPersistentSegmentInfo({
322
+ * collectionName: 'my_collection',
323
+ * });
363
324
  * ```
364
325
  */
365
326
  getPersistentSegmentInfo(data: GePersistentSegmentInfoReq): Promise<GePersistentSegmentInfoResponse>;
366
327
  /**
367
- * Import data from files
368
- *
369
- * @param data
370
- * | Property | Type | Description |
371
- * | :--- | :-- | :-- |
372
- * | collection_name | String | The name of the collection |
373
- * | files | string[] | File path array |
374
- *
375
- *
376
- * @returns
377
- * | Property | Description |
378
- * | :--- | :-- |
379
- * | status | { error_code: number,reason:string } |
380
- * | tasks | taskId array |
328
+ * Import data from files.
381
329
  *
330
+ * @param {ImportReq} data - The request parameters.
331
+ * @param {string} data.collection_name - The name of the collection.
332
+ * @param {string[]} data.files - Array of file paths.
333
+ * @param {number} [data.timeout] - 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.
382
334
  *
383
- * #### Example
335
+ * @returns {Promise<ImportResponse>} The result of the operation.
336
+ * @returns {string} status.error_code - The error code of the operation.
337
+ * @returns {string} status.reason - The reason for the error, if any.
338
+ * @returns {string[]} tasks - Array of task IDs.
384
339
  *
340
+ * @example
385
341
  * ```
386
- * const res = await bulkInsert({
387
- * collection_name: COLLECTION,
388
- * files: [`path-to-data-file.json`]
389
- * });
342
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
343
+ * const importResponse = await milvusClient.bulkInsert({
344
+ * collection_name: 'my_collection',
345
+ * files: ['path-to-data-file.json'],
346
+ * });
390
347
  * ```
391
348
  */
392
349
  bulkInsert(data: ImportReq): Promise<ImportResponse>;
393
350
  /**
394
- * List import tasks
395
- *
396
- * @param data
397
- * | Property | Type | Description |
398
- * | :--- | :-- | :-- |
399
- * | collection_name | String | The name of the collection |
400
- * | limit | number | optional, maximum number of tasks returned, list all tasks if the value is 0 |
401
- *
402
- *
403
- * @returns
404
- * | Property | Description |
405
- * | :--- | :-- |
406
- * | status | { error_code: number,reason:string } |
407
- * | state | import state |
408
- * | row_count | how many rows to import|
409
- * | id_list| id lists |
410
- * | collection_id | collection to be imported to |
411
- * | tasks | taskId array |
412
- *
413
- *
414
- * #### Example
415
- *
351
+ * List import tasks.
352
+ *
353
+ * @param {ListImportTasksReq} data - The request parameters.
354
+ * @param {string} data.collection_name - The name of the collection.
355
+ * @param {number} [data.limit] - Optional, maximum number of tasks returned, list all tasks if the value is 0.
356
+ * @param {number} [data.timeout] - 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.
357
+ *
358
+ * @returns {Promise<ListImportTasksResponse>} The result of the operation.
359
+ * @returns {string} status.error_code - The error code of the operation.
360
+ * @returns {string} status.reason - The reason for the error, if any.
361
+ * @returns {string} state - Import state.
362
+ * @returns {number} row_count - How many rows to import.
363
+ * @returns {string[]} id_list - ID lists.
364
+ * @returns {string} collection_id - Collection to be imported to.
365
+ * @returns {string[]} tasks - TaskId array.
366
+ *
367
+ * @example
416
368
  * ```
417
- * const res = await listImportTasks({
418
- * collection_name: COLLECTION
419
- * });
369
+ * const milvusClient = new milvusClient(MILUVS_ADDRESS);
370
+ * const listImportTasksResponse = await milvusClient.listImportTasks({
371
+ * collection_name: 'my_collection',
372
+ * });
420
373
  * ```
421
374
  */
422
375
  listImportTasks(data: ListImportTasksReq): Promise<ListImportTasksResponse>;