|
@@ -9,319 +9,560 @@ option java_outer_classname = "MilvusProto";
|
|
package milvus.grpc;
|
|
package milvus.grpc;
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Table Name
|
|
* @brief Table Name
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message TableName {
|
|
message TableName {
|
|
|
|
+
|
|
string table_name = 1;
|
|
string table_name = 1;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Table Name List
|
|
* @brief Table Name List
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message TableNameList {
|
|
message TableNameList {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
repeated string table_names = 2;
|
|
repeated string table_names = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Table Schema
|
|
* @brief Table Schema
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message TableSchema {
|
|
message TableSchema {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
string table_name = 2;
|
|
string table_name = 2;
|
|
|
|
+
|
|
int64 dimension = 3;
|
|
int64 dimension = 3;
|
|
|
|
+
|
|
int64 index_file_size = 4;
|
|
int64 index_file_size = 4;
|
|
|
|
+
|
|
int32 metric_type = 5;
|
|
int32 metric_type = 5;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Range Schema
|
|
* @brief Range Schema
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message Range {
|
|
message Range {
|
|
|
|
+
|
|
string start_value = 1;
|
|
string start_value = 1;
|
|
|
|
+
|
|
string end_value = 2;
|
|
string end_value = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Record inserted
|
|
* @brief Record inserted
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message RowRecord {
|
|
message RowRecord {
|
|
- repeated float vector_data = 1; //binary vector data
|
|
|
|
|
|
+
|
|
|
|
+ repeated float vector_data = 1; //binary vector data
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief params to be inserted
|
|
* @brief params to be inserted
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message InsertParam {
|
|
message InsertParam {
|
|
|
|
+
|
|
string table_name = 1;
|
|
string table_name = 1;
|
|
|
|
+
|
|
repeated RowRecord row_record_array = 2;
|
|
repeated RowRecord row_record_array = 2;
|
|
- repeated int64 row_id_array = 3; //optional
|
|
|
|
|
|
+
|
|
|
|
+ repeated int64 row_id_array = 3; //optional
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Vector ids
|
|
* @brief Vector ids
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message VectorIds {
|
|
message VectorIds {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
repeated int64 vector_id_array = 2;
|
|
repeated int64 vector_id_array = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief params for searching vector
|
|
* @brief params for searching vector
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message SearchParam {
|
|
message SearchParam {
|
|
|
|
+
|
|
string table_name = 1;
|
|
string table_name = 1;
|
|
|
|
+
|
|
repeated RowRecord query_record_array = 2;
|
|
repeated RowRecord query_record_array = 2;
|
|
|
|
+
|
|
repeated Range query_range_array = 3;
|
|
repeated Range query_range_array = 3;
|
|
|
|
+
|
|
int64 topk = 4;
|
|
int64 topk = 4;
|
|
|
|
+
|
|
int64 nprobe = 5;
|
|
int64 nprobe = 5;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief params for searching vector in files
|
|
* @brief params for searching vector in files
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message SearchInFilesParam {
|
|
message SearchInFilesParam {
|
|
|
|
+
|
|
repeated string file_id_array = 1;
|
|
repeated string file_id_array = 1;
|
|
|
|
+
|
|
SearchParam search_param = 2;
|
|
SearchParam search_param = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Query result params
|
|
* @brief Query result params
|
|
- */
|
|
|
|
-message QueryResult {
|
|
|
|
- int64 id = 1;
|
|
|
|
- double distance = 2;
|
|
|
|
-}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
- * @brief TopK query result
|
|
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message TopKQueryResult {
|
|
message TopKQueryResult {
|
|
- repeated QueryResult query_result_arrays = 1;
|
|
|
|
-}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
- * @brief List of topK query result
|
|
|
|
- */
|
|
|
|
-message TopKQueryResultList {
|
|
|
|
Status status = 1;
|
|
Status status = 1;
|
|
- repeated TopKQueryResult topk_query_result = 2;
|
|
|
|
|
|
+
|
|
|
|
+ int64 row_num = 2;
|
|
|
|
+
|
|
|
|
+ repeated int64 ids = 3;
|
|
|
|
+
|
|
|
|
+ repeated float distances = 4;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Server String Reply
|
|
* @brief Server String Reply
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message StringReply {
|
|
message StringReply {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
string string_reply = 2;
|
|
string string_reply = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Server bool Reply
|
|
* @brief Server bool Reply
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message BoolReply {
|
|
message BoolReply {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
bool bool_reply = 2;
|
|
bool bool_reply = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Return table row count
|
|
* @brief Return table row count
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message TableRowCount {
|
|
message TableRowCount {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
int64 table_row_count = 2;
|
|
int64 table_row_count = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Give Server Command
|
|
* @brief Give Server Command
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message Command {
|
|
message Command {
|
|
|
|
+
|
|
string cmd = 1;
|
|
string cmd = 1;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Index
|
|
* @brief Index
|
|
|
|
+
|
|
* @index_type: 0-invalid, 1-idmap, 2-ivflat, 3-ivfsq8, 4-nsgmix
|
|
* @index_type: 0-invalid, 1-idmap, 2-ivflat, 3-ivfsq8, 4-nsgmix
|
|
|
|
+
|
|
* @metric_type: 1-L2, 2-IP
|
|
* @metric_type: 1-L2, 2-IP
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message Index {
|
|
message Index {
|
|
|
|
+
|
|
int32 index_type = 1;
|
|
int32 index_type = 1;
|
|
|
|
+
|
|
int32 nlist = 2;
|
|
int32 nlist = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Index params
|
|
* @brief Index params
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message IndexParam {
|
|
message IndexParam {
|
|
|
|
+
|
|
Status status = 1;
|
|
Status status = 1;
|
|
|
|
+
|
|
string table_name = 2;
|
|
string table_name = 2;
|
|
|
|
+
|
|
Index index = 3;
|
|
Index index = 3;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief table name and range for DeleteByRange
|
|
* @brief table name and range for DeleteByRange
|
|
|
|
+
|
|
*/
|
|
*/
|
|
|
|
+
|
|
message DeleteByRangeParam {
|
|
message DeleteByRangeParam {
|
|
|
|
+
|
|
Range range = 1;
|
|
Range range = 1;
|
|
|
|
+
|
|
string table_name = 2;
|
|
string table_name = 2;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
service MilvusService {
|
|
service MilvusService {
|
|
|
|
+
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Create table method
|
|
* @brief Create table method
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to create table
|
|
* This method is used to create table
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param param, use to provide table information to be created.
|
|
* @param param, use to provide table information to be created.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc CreateTable(TableSchema) returns (Status){}
|
|
|
|
|
|
+
|
|
|
|
+ rpc CreateTable (TableSchema) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Test table existence method
|
|
* @brief Test table existence method
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to test table existence.
|
|
* This method is used to test table existence.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, table name is going to be tested.
|
|
* @param table_name, table name is going to be tested.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc HasTable(TableName) returns (BoolReply) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc HasTable (TableName) returns (BoolReply) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Delete table method
|
|
* @brief Delete table method
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to delete table.
|
|
* This method is used to delete table.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, table name is going to be deleted.
|
|
* @param table_name, table name is going to be deleted.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc DropTable(TableName) returns (Status) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc DropTable (TableName) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Build index by table method
|
|
* @brief Build index by table method
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to build index by table in sync mode.
|
|
* This method is used to build index by table in sync mode.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, table is going to be built index.
|
|
* @param table_name, table is going to be built index.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc CreateIndex(IndexParam) returns (Status) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc CreateIndex (IndexParam) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Add vector array to table
|
|
* @brief Add vector array to table
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to add vector array to table.
|
|
* This method is used to add vector array to table.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, table_name is inserted.
|
|
* @param table_name, table_name is inserted.
|
|
|
|
+
|
|
* @param record_array, vector array is inserted.
|
|
* @param record_array, vector array is inserted.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return vector id array
|
|
* @return vector id array
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc Insert(InsertParam) returns (VectorIds) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc Insert (InsertParam) returns (VectorIds) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Query vector
|
|
* @brief Query vector
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to query vector in table.
|
|
* This method is used to query vector in table.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, table_name is queried.
|
|
* @param table_name, table_name is queried.
|
|
|
|
+
|
|
* @param query_record_array, all vector are going to be queried.
|
|
* @param query_record_array, all vector are going to be queried.
|
|
|
|
+
|
|
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
|
|
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
|
|
|
|
+
|
|
* @param topk, how many similarity vectors will be searched.
|
|
* @param topk, how many similarity vectors will be searched.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return query result array.
|
|
* @return query result array.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc Search(SearchParam) returns (TopKQueryResultList) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc Search (SearchParam) returns (TopKQueryResult) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Internal use query interface
|
|
* @brief Internal use query interface
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to query vector in specified files.
|
|
* This method is used to query vector in specified files.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param file_id_array, specified files id array, queried.
|
|
* @param file_id_array, specified files id array, queried.
|
|
|
|
+
|
|
* @param query_record_array, all vector are going to be queried.
|
|
* @param query_record_array, all vector are going to be queried.
|
|
|
|
+
|
|
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
|
|
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
|
|
|
|
+
|
|
* @param topk, how many similarity vectors will be searched.
|
|
* @param topk, how many similarity vectors will be searched.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return query result array.
|
|
* @return query result array.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc SearchInFiles(SearchInFilesParam) returns (TopKQueryResultList) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc SearchInFiles (SearchInFilesParam) returns (TopKQueryResult) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Get table schema
|
|
* @brief Get table schema
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to get table schema.
|
|
* This method is used to get table schema.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, target table name.
|
|
* @param table_name, target table name.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return table schema
|
|
* @return table schema
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc DescribeTable(TableName) returns (TableSchema) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc DescribeTable (TableName) returns (TableSchema) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Get table schema
|
|
* @brief Get table schema
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to get table schema.
|
|
* This method is used to get table schema.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @param table_name, target table name.
|
|
* @param table_name, target table name.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return table schema
|
|
* @return table schema
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc CountTable(TableName) returns (TableRowCount) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc CountTable (TableName) returns (TableRowCount) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief List all tables in database
|
|
* @brief List all tables in database
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to list all tables.
|
|
* This method is used to list all tables.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return table names.
|
|
* @return table names.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc ShowTables(Command) returns (TableNameList) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc ShowTables (Command) returns (TableNameList) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief Give the server status
|
|
* @brief Give the server status
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to give the server status.
|
|
* This method is used to give the server status.
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return Server status.
|
|
* @return Server status.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc Cmd(Command) returns (StringReply) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc Cmd (Command) returns (StringReply) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief delete table by range
|
|
* @brief delete table by range
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to delete vector by range
|
|
* This method is used to delete vector by range
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return rpc status.
|
|
* @return rpc status.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc DeleteByRange(DeleteByRangeParam) returns (Status) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc DeleteByRange (DeleteByRangeParam) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief preload table
|
|
* @brief preload table
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to preload table
|
|
* This method is used to preload table
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return Status.
|
|
* @return Status.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc PreloadTable(TableName) returns (Status) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc PreloadTable (TableName) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief describe index
|
|
* @brief describe index
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to describe index
|
|
* This method is used to describe index
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return Status.
|
|
* @return Status.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc DescribeIndex(TableName) returns (IndexParam) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc DescribeIndex (TableName) returns (IndexParam) {
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+
|
|
* @brief drop index
|
|
* @brief drop index
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* This method is used to drop index
|
|
* This method is used to drop index
|
|
|
|
+
|
|
*
|
|
*
|
|
|
|
+
|
|
* @return Status.
|
|
* @return Status.
|
|
|
|
+
|
|
*/
|
|
*/
|
|
- rpc DropIndex(TableName) returns (Status) {}
|
|
|
|
|
|
+
|
|
|
|
+ rpc DropIndex (TableName) returns (Status) {
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|