|
|
@@ -43,6 +43,7 @@ service DatabaseService {
|
|
|
// Query operations
|
|
|
rpc Find(FindRequest) returns (FindResponse);
|
|
|
rpc Count(CountRequest) returns (CountResponse);
|
|
|
+ rpc SimilaritySearch(SimilaritySearchRequest) returns (SimilaritySearchResponse);
|
|
|
|
|
|
// Set operations (Redis compatibility)
|
|
|
rpc SetAdd(SetAddRequest) returns (SetAddResponse);
|
|
|
@@ -332,6 +333,23 @@ message CountResponse {
|
|
|
uint64 count = 1;
|
|
|
}
|
|
|
|
|
|
+message SimilaritySearchRequest {
|
|
|
+ string collection = 1;
|
|
|
+ repeated float query_vector = 2;
|
|
|
+ uint32 top_k = 3;
|
|
|
+ float min_score = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message SimilaritySearchResponse {
|
|
|
+ repeated SimilarityResult results = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message SimilarityResult {
|
|
|
+ string id = 1;
|
|
|
+ float score = 2;
|
|
|
+ bytes data = 3;
|
|
|
+}
|
|
|
+
|
|
|
// ===== Set Operations =====
|
|
|
|
|
|
message SetAddRequest {
|
|
|
@@ -386,6 +404,7 @@ message CollectionOptions {
|
|
|
bool encrypted = 3;
|
|
|
repeated string sensitive_fields = 4;
|
|
|
uint32 max_versions = 5; // Max version history per document (0 = unlimited)
|
|
|
+ uint32 vector_dimension = 6; // Dimension of vectors stored in this collection (0 = not a vector collection)
|
|
|
}
|
|
|
|
|
|
message CreateCollectionResponse {
|
|
|
@@ -423,6 +442,7 @@ message CollectionInfo {
|
|
|
CollectionOptions options = 4;
|
|
|
uint64 created_at = 5;
|
|
|
uint64 updated_at = 6;
|
|
|
+ uint32 vector_dimension = 7; // Dimension of vectors stored in this collection (0 = not a vector collection)
|
|
|
}
|
|
|
|
|
|
// ===== File Operations =====
|