@zilliz/milvus2-sdk-node 2.3.5 → 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.
- package/README.md +154 -35
- package/dist/milvus/HttpClient.d.ts +165 -2
- package/dist/milvus/HttpClient.js +17 -3
- package/dist/milvus/HttpClient.js.map +1 -1
- package/dist/milvus/MilvusClient.d.ts +3 -3
- package/dist/milvus/MilvusClient.js +42 -8
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/const/client.d.ts +4 -3
- package/dist/milvus/const/client.js +4 -3
- package/dist/milvus/const/client.js.map +1 -1
- package/dist/milvus/const/defaults.d.ts +5 -4
- package/dist/milvus/const/defaults.js +14 -13
- package/dist/milvus/const/defaults.js.map +1 -1
- package/dist/milvus/const/error.js +1 -1
- package/dist/milvus/const/error.js.map +1 -1
- package/dist/milvus/const/milvus.d.ts +47 -8
- package/dist/milvus/const/milvus.js +42 -3
- package/dist/milvus/const/milvus.js.map +1 -1
- package/dist/milvus/grpc/BaseClient.d.ts +11 -9
- package/dist/milvus/grpc/BaseClient.js +59 -21
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.d.ts +311 -366
- package/dist/milvus/grpc/Collection.js +355 -387
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +244 -291
- package/dist/milvus/grpc/Data.js +402 -539
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/grpc/Database.d.ts +29 -41
- package/dist/milvus/grpc/Database.js +32 -44
- package/dist/milvus/grpc/Database.js.map +1 -1
- package/dist/milvus/grpc/GrpcClient.d.ts +34 -13
- package/dist/milvus/grpc/GrpcClient.js +80 -70
- package/dist/milvus/grpc/GrpcClient.js.map +1 -1
- package/dist/milvus/grpc/MilvusIndex.d.ts +127 -67
- package/dist/milvus/grpc/MilvusIndex.js +166 -70
- package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
- package/dist/milvus/grpc/Partition.d.ts +78 -113
- package/dist/milvus/grpc/Partition.js +109 -119
- package/dist/milvus/grpc/Partition.js.map +1 -1
- package/dist/milvus/grpc/Resource.d.ts +63 -92
- package/dist/milvus/grpc/Resource.js +69 -98
- package/dist/milvus/grpc/Resource.js.map +1 -1
- package/dist/milvus/grpc/User.d.ts +263 -295
- package/dist/milvus/grpc/User.js +287 -310
- package/dist/milvus/grpc/User.js.map +1 -1
- package/dist/milvus/http/Alias.d.ts +37 -0
- package/dist/milvus/http/Alias.js +62 -0
- package/dist/milvus/http/Alias.js.map +1 -0
- package/dist/milvus/http/Collection.d.ts +15 -1
- package/dist/milvus/http/Collection.js +55 -9
- package/dist/milvus/http/Collection.js.map +1 -1
- package/dist/milvus/http/Import.d.ts +33 -0
- package/dist/milvus/http/Import.js +48 -0
- package/dist/milvus/http/Import.js.map +1 -0
- package/dist/milvus/http/MilvusIndex.d.ts +35 -0
- package/dist/milvus/http/MilvusIndex.js +55 -0
- package/dist/milvus/http/MilvusIndex.js.map +1 -0
- package/dist/milvus/http/Partition.d.ts +41 -0
- package/dist/milvus/http/Partition.js +76 -0
- package/dist/milvus/http/Partition.js.map +1 -0
- package/dist/milvus/http/Role.d.ts +39 -0
- package/dist/milvus/http/Role.js +69 -0
- package/dist/milvus/http/Role.js.map +1 -0
- package/dist/milvus/http/User.d.ts +41 -0
- package/dist/milvus/http/User.js +76 -0
- package/dist/milvus/http/User.js.map +1 -0
- package/dist/milvus/http/Vector.d.ts +5 -3
- package/dist/milvus/http/Vector.js +10 -7
- package/dist/milvus/http/Vector.js.map +1 -1
- package/dist/milvus/http/index.d.ts +6 -0
- package/dist/milvus/http/index.js +6 -0
- package/dist/milvus/http/index.js.map +1 -1
- package/dist/milvus/index.d.ts +0 -1
- package/dist/milvus/index.js +0 -1
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +5 -0
- package/dist/milvus/types/Collection.d.ts +34 -9
- package/dist/milvus/types/Common.d.ts +1 -3
- package/dist/milvus/types/Data.d.ts +79 -23
- package/dist/milvus/types/Data.js +1 -0
- package/dist/milvus/types/Data.js.map +1 -1
- package/dist/milvus/types/HighLevel.d.ts +6 -3
- package/dist/milvus/types/Http.d.ts +191 -9
- package/dist/milvus/types/MilvusIndex.d.ts +17 -3
- package/dist/milvus/utils/Bytes.d.ts +84 -0
- package/dist/milvus/utils/Bytes.js +261 -0
- package/dist/milvus/utils/Bytes.js.map +1 -0
- package/dist/milvus/utils/Format.d.ts +126 -68
- package/dist/milvus/utils/Format.js +375 -94
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/Function.d.ts +4 -2
- package/dist/milvus/utils/Function.js +58 -25
- package/dist/milvus/utils/Function.js.map +1 -1
- package/dist/milvus/utils/Grpc.d.ts +3 -2
- package/dist/milvus/utils/Grpc.js +65 -98
- package/dist/milvus/utils/Grpc.js.map +1 -1
- package/dist/milvus/utils/Validate.d.ts +18 -3
- package/dist/milvus/utils/Validate.js +38 -12
- package/dist/milvus/utils/Validate.js.map +1 -1
- package/dist/milvus/utils/index.d.ts +1 -1
- package/dist/milvus/utils/index.js +1 -1
- package/dist/milvus/utils/index.js.map +1 -1
- package/dist/proto/proto/common.proto +26 -1
- package/dist/proto/proto/google/protobuf/descriptor.proto +90 -28
- package/dist/proto/proto/milvus.proto +168 -2
- package/dist/proto/proto/rg.proto +28 -0
- package/dist/proto/proto/schema.proto +34 -0
- package/dist/sdk.json +1 -1
- package/package.json +8 -5
- package/dist/milvus/OrmClient.d.ts +0 -19
- package/dist/milvus/OrmClient.js +0 -51
- package/dist/milvus/OrmClient.js.map +0 -1
- package/dist/milvus/orm/Collection.d.ts +0 -43
- package/dist/milvus/orm/Collection.js +0 -165
- package/dist/milvus/orm/Collection.js.map +0 -1
- package/dist/milvus/orm/index.d.ts +0 -1
- package/dist/milvus/orm/index.js +0 -18
- package/dist/milvus/orm/index.js.map +0 -1
- package/dist/milvus/utils/Blob.d.ts +0 -4
- package/dist/milvus/utils/Blob.js +0 -18
- package/dist/milvus/utils/Blob.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
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
|
|
15
|
-
*
|
|
16
|
-
* @param data
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* @returns
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
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)
|
|
38
|
-
*
|
|
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
|
-
* @
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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
|
-
*
|
|
67
|
-
*
|
|
56
|
+
* @example
|
|
68
57
|
* ```
|
|
69
|
-
* new milvusClient(MILUVS_ADDRESS)
|
|
70
|
-
*
|
|
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
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
* @returns
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
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)
|
|
99
|
-
*
|
|
100
|
-
*
|
|
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
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* @returns
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
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)
|
|
133
|
-
*
|
|
134
|
-
*
|
|
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
|
-
*
|
|
141
|
-
*
|
|
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
|
-
* @
|
|
150
|
-
*
|
|
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
|
-
*
|
|
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)
|
|
158
|
-
*
|
|
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
|
-
*
|
|
165
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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)
|
|
183
|
-
*
|
|
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
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* @returns
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
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)
|
|
195
|
+
* const milvusClient = new milvusClient(MILUVS_ADDRESS);
|
|
196
|
+
* const queryResults = await milvusClient.query({
|
|
213
197
|
* collection_name: 'my_collection',
|
|
214
|
-
*
|
|
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
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* @param data
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* @returns
|
|
236
|
-
*
|
|
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)
|
|
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
|
|
241
|
+
* Get the flush state of specified segment IDs in Milvus.
|
|
263
242
|
*
|
|
264
|
-
* @param data
|
|
265
|
-
*
|
|
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
|
-
*
|
|
278
|
-
*
|
|
252
|
+
* @example
|
|
279
253
|
* ```
|
|
280
|
-
*
|
|
281
|
-
*
|
|
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
|
-
*
|
|
288
|
-
*
|
|
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
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
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
|
-
*
|
|
306
|
-
*
|
|
276
|
+
* @example
|
|
307
277
|
* ```
|
|
308
|
-
*
|
|
309
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
332
|
-
*
|
|
297
|
+
* @example
|
|
333
298
|
* ```
|
|
334
|
-
*
|
|
335
|
-
*
|
|
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
|
-
/**
|
|
306
|
+
/**
|
|
341
307
|
* Notifies Proxy to return segments information from data nodes.
|
|
342
308
|
*
|
|
343
|
-
* @param data
|
|
344
|
-
*
|
|
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
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
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
|
-
*
|
|
361
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
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
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* @returns
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
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
|
-
*
|
|
418
|
-
*
|
|
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>;
|