Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
partition_name(optional) | String | Partition name |
expr | String | Boolean expression used to filter attribute. |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
IDs | ID array of the successfully deleted data |
new milvusClient(MILUVS_ADDRESS).dataManager.deleteEntities({
collection_name: COLLECTION_NAME,
expr: 'id in [1,2,3,4]'
});
Milvus temporarily buffers the newly inserted vectors in the cache. Call flush()
to persist them to the object storage.
It's async function, so it's will take some times to excute.
Property | Type | Description |
---|---|---|
collection_names | String[] | Array of collection names |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
new milvusClient(MILUVS_ADDRESS).dataManager.flush({
collection_names: ['my_collection'],
});
It's same function as flush. But flushSync is sync function. So you can ensure it's flushed after function return the result.
Property | Type | Description |
---|---|---|
collection_names | String[] | Array of collection names |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
new milvusClient(MILUVS_ADDRESS).dataManager.flushSync({
collection_names: ['my_collection'],
});
Get flush state by segment ids
Property | Type | Description |
---|---|---|
segmentIDs | Array | The segment ids |
Property | Description |
---|---|
status | { error_code: number,reason:string } |
flushed | segments flushed or not |
const res = await milvusClient.dataManager.getFlushState({
segmentIDs: segIds,
});
Notifies Proxy to return segments information from query nodes.
Property | Type | Description |
---|---|---|
collectionName | String | The name of the collection to get segments info. |
Property | Description |
---|---|
status | { error_code: number,reason:string } |
infos | QuerySegmentInfo is the growing segments's information in query cluster. |
const res = await dataManager.getQuerySegmentInfo({
collectionName: COLLECTION,
});
Insert data into Milvus.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
partition_name(optional) | String | Partition name |
fields_data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
hash_keys(optional) | Number[] | The hash value depends on the primarykey value |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
succ_index | Index array of the successfully inserted data |
err_index | Index array of the unsuccessfully inserted data |
IDs | ID array of the successfully inserted data |
new milvusClient(MILUVS_ADDRESS).dataManager.insert({
collection_name: COLLECTION_NAME,
fields_data: [{
vector_field: [1,2,2,4],
scalar_field: 1
}]
});
Do load balancing operation from source query node to destination query node. Only work in cluster milvus.
Property | Type | Description |
---|---|---|
src_nodeID | number | The source query node id to balance. |
dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
Property | Description |
---|---|
status | { error_code: number,reason:string } |
infos | segments infomations |
const res = await dataManager.loadBalance({
src_nodeID: 31,
});
Query vector data in Milvus. Current release of Milvus only supports expression as fieldname in [id1,id2,id3]
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
expr | String | Scalar field filter expression |
partitions_names(optional) | String[] | Array of partition names |
output_fields | String[] | Vector or scalar field to be returned |
Property | Description |
---|---|
status | { error_code: number,reason:string } |
data | Data of all fields that you defined in output_fields , {field_name: value}[] |
new milvusClient(MILUVS_ADDRESS).dataManager.query({
collection_name: 'my_collection',
expr: "age in [1,2,3,4,5,6,7,8]",
output_fields: ["age"],
});
Perform vector similarity search.
Property | Type | Description |
---|---|---|
collection_name | String | Collection name |
partition_names(optional) | String[] | Array of partition names |
expr(optional) | String | Scalar field filter expression |
search_params | Object | anns_field: vector field name topk: search result counts metric_type params: search params |
vectors | Number[][] | Original vector to search with |
output_fields(optional) | String[] | Support scalar field |
vector_type | enum | Binary field -> 100, Float field -> 101 |
travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search. |
Property | Description |
---|---|
status | { error_code: number, reason: string } |
results | {score:number,id:string}[]; |
new milvusClient(MILUVS_ADDRESS).dataManager.search({
collection_name: COLLECTION_NAME,
expr: "",
vectors: [[1, 2, 3, 4]],
search_params: {
anns_field: VECTOR_FIELD_NAME,
topk: "4",
metric_type: "L2",
params: JSON.stringify({ nprobe: 1024 }),
},
output_fields: ["age", "time"],
vector_type: 100,
});
Delete entities in Milvus