// If time_stamp is not zero, will return true when time_stamp >= created collection timestamp, otherwise will return false.
uint64 time_stamp = 4;
}
```
## LoadCollection
Load a collection data into cache of query node. Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
Note: this interface only send a request to server ask to load collection, it returns at once after the request is consumed. Collection loading progress is asynchronously.
Release a collection data from cache of query node. Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
Get a collection's information including id, schema, alias, timestamp and internal data transfer channel. (Some returned information is for developers).
Load multiple partitions data into cache of query node. Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
Note: this interface only send a request to server ask to load partitions, it returns at once after the request is consumed. Loading progress is asynchronously.
Release partitions data from cache of query node. Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
Alter an alias from a collection to another. Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
For more information please refer the [document](https://wiki.lfaidata.foundation/display/MIL/MEP+10+--+Support+Collection+Alias).
// Specifiy output fields, the returned result will return other fields data. (Optional)
repeated string output_fields = 8;
// ANN search parameters. For example, if the index is IVF, the search parameters will be: "nprobe":xxx
repeated common.KeyValuePair search_params = 9;
// Filtering entities by timestamp. (Optional)
uint64 travel_timestamp = 10;
// The time tolerance between entities visibility and search action. Default is 0. In Milvus, each entity has a timestamp. To ensure data consistence, each node(query node and data node) will consume data in a time interval. So entity visibility is a bit later than its timestamp. If this value is 0, Milvus will hold the search action, wait until all entities whose timestamp is earlier that the search action's timestamp to be fully consumed.
uint64 guarantee_timestamp = 11;
}
```
### SearchResults
See [schema.SearchResultData](#searchresultdata).
```
message SearchResults {
// Response status
common.Status status = 1;
// Search results
schema.SearchResultData results = 2;
}
```
## Flush
Flush data node's buffer into storage. After flush, all growing segments become sealed, and persisted into storage asynchronously.
Handoff segments from one query node to others. Client can use GetPersistentSegmentInfo() to know which segment loaded on which query node, then use LoadBalance() to reassign them into different query node.
Return a `common.Status`(see [common.Status](#status)) to tell client whether the operation is successful.
For more information, refer this [document](https://wiki.lfaidata.foundation/display/MIL/MEP+17+--+Support+handoff+and+load+balance+segment+on+query+nodes).
// The runtime plans of the compaction action. See CompactionMergeInfo
repeated CompactionMergeInfo mergeInfos = 3;
}
```
### CompactionMergeInfo
```
message CompactionMergeInfo {
// Segment id array to be merged
repeated int64 sources = 1;
// New generated segment id after merging
int64 target = 2;
}
```
## ShowType
```
enum ShowType {
// Will return all colloections
All = 0;
// Will return loaded collections with their inMemory_percentages
InMemory = 1;
}
```
[back to top](#brief)
## BoolResponse
Used by [HasCollection()](#hascollection) and [HasPartition()](#haspartition).
```
message BoolResponse {
// Response status
common.Status status = 1;
// bool value
bool value = 2;
}
```
[back to top](#brief)
## MutationResult
Used by [Insert()](#insert) and [Delete()](#delete).
```
message MutationResult {
// Response status
common.Status status = 1;
// For insert, return the ids of inserted entities.
// For delete, return the ids of input to be deleted.
schema.IDs IDs = 2;
// Reserved. Indicate succeed indexes.
repeated uint32 succ_index = 3;
// Reserved. Indicate error indexes.
repeated uint32 err_index = 4;
// Reserved.
bool acknowledged = 5;
// Reserved.
int64 insert_cnt = 6;
// Reserved.
int64 delete_cnt = 7;
// Reserved.
int64 upsert_cnt = 8;
// Reserved.
uint64 timestamp = 9;
}
```
[back to top](#brief)
# common.proto
## ErrorCode
Error code retrurned by server.
```
enum ErrorCode {
Success = 0;
UnexpectedError = 1;
ConnectFailed = 2;
PermissionDenied = 3;
CollectionNotExists = 4;
IllegalArgument = 5;
IllegalDimension = 7;
IllegalIndexType = 8;
IllegalCollectionName = 9;
IllegalTOPK = 10;
IllegalRowRecord = 11;
IllegalVectorID = 12;
IllegalSearchResult = 13;
FileNotFound = 14;
MetaFailed = 15;
CacheFailed = 16;
CannotCreateFolder = 17;
CannotCreateFile = 18;
CannotDeleteFolder = 19;
CannotDeleteFile = 20;
BuildIndexError = 21;
IllegalNLIST = 22;
IllegalMetricType = 23;
OutOfMemory = 24;
IndexNotExist = 25;
EmptyCollection = 26;
// internal error code.
DDRequestRace = 1000;
}
```
[back to top](#brief)
## IndexState
Used by [GetIndexState()](#getindexstate).
```
enum IndexState {
IndexStateNone = 0;
// Build index not yet assigned or begin
Unissued = 1;
// Build index in progress
InProgress = 2;
// Build index finished
Finished = 3;
// Build index failed
Failed = 4;
}
```
[back to top](#brief)
## SegmentState
Used by [GetPersistentSegmentInfo()](#getpersistentsegmentinfo) and [GetQuerySegmentInfo()](#getquerysegmentinfo).
```
enum SegmentState {
SegmentStateNone = 0;
// Segment doesn't exist
NotExist = 1;
// Segment is in buffer, waiting for insert, not yet persisted
Growing = 2;
// Segment is in buffer, but is sealed, not allow insert
Sealed = 3;
// Segment was persisted into storage
Flushed = 4;
// Segment is to be flushed into storage
Flushing = 5;
// Segment has been marked as deleted
Dropped = 6;
}
```
[back to top](#brief)
## Status
Used by some interfaces to return server error code and message.
See [ErrorCode](#errorcode).
```
message Status {
// See ErrorCode
ErrorCode error_code = 1;
// Fail reason if the error_code is not Success
string reason = 2;
}
```
[back to top](#brief)
## KeyValuePair
Pass key(string)-value(string) paremeters to server, for example "nlist":"1024".
```
message KeyValuePair {
string key = 1;
string value = 2;
}
```
[back to top](#brief)
## KeyDataPair
Pass key(string)-value(binary data) paremeters to server.
```
message KeyDataPair {
string key = 1;
bytes data = 2;
}
```
[back to top](#brief)
## DslType
Used to support DSL(Domain Specific Language). But now only support expression. Now in [SearchRequest](#searchrequest) the `DslType` always be `BoolExprV1`.
```
enum DslType {
Dsl = 0;
BoolExprV1 = 1;
}
```
[back to top](#brief)
## CompactionState
Used by [GetCompactionState()](#getcompactionstate) to get compaction state.
```
enum CompactionState {
UndefiedState = 0;
// Compaction action is in progress
Executing = 1;
// Compaction action completed
Completed = 2;
}
```
[back to top](#brief)
# schema.proto
## DataType
To define field data type.
```
enum DataType {
None = 0;
Bool = 1;
Int8 = 2;
Int16 = 3;
Int32 = 4;
Int64 = 5;
Float = 10;
Double = 11;
// Not avaiable in v2.0, plan to support in 2.1
String = 20;
// Binary vector, each dimension is one bit
BinaryVector = 100;
// Float vector, each dimension is a float
FloatVector = 101;
}
```
[back to top](#brief)
## FieldSchema
To define field schema. Used by [CreateCollection()](#createcollection).
```
message FieldSchema {
// Field unique id, typically sdk ought to automatically set this id for user.
int64 fieldID = 1;
// Field name. (Required)
string name = 2;
// Is primary key or not, each collection only has one primary key field. Currently only support int64 type field as primary key. Once string type is supported, string type field also can be primary key. Default is false.
bool is_primary_key = 3;
// Field description. (Optional)
string description = 4;
// Field data type, see DataType.
DataType data_type = 5;
// Extra parameters. Reserved.
repeated common.KeyValuePair type_params = 6;
// Deprecated
repeated common.KeyValuePair index_params = 7;
// When it is true, Milvus will automatically generate id for each entity. Only primary key field can set autoID as true. Default is false.
bool autoID = 8;
}
```
[back to top](#brief)
## CollectionSchema
To define collection schema. Used by [CreateCollection()](#createcollection).
```
message CollectionSchema {
// Collection name. (Required)
string name = 1;
// Collection description. (Optional)
string description = 2;
// Deprecated
bool autoID = 3;
// Fields schema, see FieldSchema. (Required)
repeated FieldSchema fields = 4;
}
```
[back to top](#brief)
## BoolArray
Bool values array.
```
message BoolArray {
repeated bool data = 1;
}
```
[back to top](#brief)
## IntArray
Integer values array.
```
message IntArray {
repeated int32 data = 1;
}
```
[back to top](#brief)
## LongArray
Long values array.
```
message LongArray {
repeated int64 data = 1;
}
```
[back to top](#brief)
## FloatArray
Float values array.
```
message FloatArray {
repeated float data = 1;
}
```
[back to top](#brief)
## DoubleArray
Double values array.
```
message DoubleArray {
repeated double data = 1;
}
```
[back to top](#brief)
## BytesArray
Byte values array. For special fields such as binary vector.
```
message BytesArray {
repeated bytes data = 1;
}
```
[back to top](#brief)
## StringArray
String values array. String type is planned in v2.1.
```
message StringArray {
repeated string data = 1;
}
```
[back to top](#brief)
## ScalarField
Store data for non-vector field.
```
message ScalarField {
oneof data {
BoolArray bool_data = 1;
IntArray int_data = 2;
LongArray long_data = 3;
FloatArray float_data = 4;
DoubleArray double_data = 5;
StringArray string_data = 6;
BytesArray bytes_data = 7;
}
}
```
[back to top](#brief)
## VectorField
Store data for vector field.
```
message VectorField {
// Vector dimension
int64 dim = 1;
oneof data {
// For float vectors. The array size is vector_count*dimension.
FloatArray float_vector = 2;
// For binary vectors. The array size is vector_count*dimension/8.
bytes binary_vector = 3;
}
}
```
[back to top](#brief)
## FieldData
Represent a field. Can be vector field or scalar field. Used by [Insert()](#insert).
```
message FieldData {
// Field data type
DataType type = 1;
// Field name. (Required)
string field_name = 2;
oneof field {
// For scalar field
ScalarField scalars = 3;
// For vector field
VectorField vectors = 4;
}
// Deprecated
int64 field_id = 5;
}
```
[back to top](#brief)
## IDs
Represent an array of ID. Used by [Insert()](#insert)/[Delete()](#delete)/[Query()](#query), return id array.
```
message IDs {
oneof id_field {
// Long id array
LongArray int_id = 1;
// String id array. String id is planned in v2.1.
StringArray str_id = 2;
}
}
```
[back to top](#brief)
## SearchResultData
Used by [Search()](#search), to return search results.
```
message SearchResultData {
// Target vectors count
int64 num_queries = 1;
// Specified search topK
int64 top_k = 2;
// Return field data specified by output field names. See Search()
repeated FieldData fields_data = 3;
// TopK scores array. The array size is num_queries*topK.
repeated float scores = 4;
// TopK ids array. The array size is num_queries*topK.
IDs ids = 5;
// Sometimes not all target vectors return same topK result. The topks will tell client the topK of each target vector.