mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
a992dcf6a8
* improve code readibility Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add offset in RetrieveResults Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add VectorFieldInfo into Segment struct Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add new interface for query vector Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update load vector field logic Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update load vector field logic Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * fill in field name in query result Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add FieldId into FieldData Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add fillVectorOutputFieldsIfNeeded Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update data_codec_test.go Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add DeserializeFieldData Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * realize query return vector output field Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * fix static-check Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * disable query vector case Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
126 lines
2.1 KiB
Protocol Buffer
126 lines
2.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package milvus.proto.schema;
|
|
option go_package = "github.com/milvus-io/milvus/internal/proto/schemapb";
|
|
|
|
import "common.proto";
|
|
|
|
/**
|
|
* @brief Field data type
|
|
*/
|
|
enum DataType {
|
|
None = 0;
|
|
Bool = 1;
|
|
Int8 = 2;
|
|
Int16 = 3;
|
|
Int32 = 4;
|
|
Int64 = 5;
|
|
|
|
Float = 10;
|
|
Double = 11;
|
|
|
|
String = 20;
|
|
|
|
BinaryVector = 100;
|
|
FloatVector = 101;
|
|
}
|
|
|
|
/**
|
|
* @brief Field schema
|
|
*/
|
|
message FieldSchema {
|
|
int64 fieldID = 1;
|
|
string name = 2;
|
|
bool is_primary_key = 3;
|
|
string description = 4;
|
|
DataType data_type = 5;
|
|
repeated common.KeyValuePair type_params = 6;
|
|
repeated common.KeyValuePair index_params = 7;
|
|
bool autoID = 8;
|
|
}
|
|
|
|
/**
|
|
* @brief Collection schema
|
|
*/
|
|
message CollectionSchema {
|
|
string name = 1;
|
|
string description = 2;
|
|
bool autoID = 3; // deprecated later, keep compatible with c++ part now
|
|
repeated FieldSchema fields = 4;
|
|
}
|
|
|
|
message BoolArray {
|
|
repeated bool data = 1;
|
|
}
|
|
|
|
message IntArray {
|
|
repeated int32 data = 1;
|
|
}
|
|
|
|
message LongArray {
|
|
repeated int64 data = 1;
|
|
}
|
|
|
|
message FloatArray {
|
|
repeated float data = 1;
|
|
}
|
|
|
|
message DoubleArray {
|
|
repeated double data = 1;
|
|
}
|
|
|
|
// For special fields such as bigdecimal, array...
|
|
message BytesArray {
|
|
repeated bytes data = 1;
|
|
}
|
|
|
|
message StringArray {
|
|
repeated string data = 1;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
message VectorField {
|
|
int64 dim = 1;
|
|
oneof data {
|
|
FloatArray float_vector = 2;
|
|
bytes binary_vector = 3;
|
|
}
|
|
}
|
|
|
|
message FieldData {
|
|
DataType type = 1;
|
|
string field_name = 2;
|
|
oneof field {
|
|
ScalarField scalars = 3;
|
|
VectorField vectors = 4;
|
|
}
|
|
int64 field_id = 5;
|
|
}
|
|
|
|
message IDs {
|
|
oneof id_field {
|
|
LongArray int_id = 1;
|
|
StringArray str_id = 2;
|
|
}
|
|
}
|
|
|
|
message SearchResultData {
|
|
int64 num_queries = 1;
|
|
int64 top_k = 2;
|
|
repeated FieldData fields_data = 3;
|
|
repeated float scores = 4;
|
|
IDs ids = 5;
|
|
repeated int64 topks = 6;
|
|
}
|