Skip to content

Instantly share code, notes, and snippets.

@bsod90
Created August 3, 2019 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsod90/46010b6b2fa4a468764440b93c0cbbee to your computer and use it in GitHub Desktop.
Save bsod90/46010b6b2fa4a468764440b93c0cbbee to your computer and use it in GitHub Desktop.
syntax = "proto3";
message TopKDocumentsRequest {
string query = 1;
int32 k = 2;
}
message DocumentsWithinDistanceRequest {
string query = 1;
double distance = 2;
}
message DocumentMatch {
int64 id = 1;
double distance = 2;
}
message SearchResponse {
enum Error {
NO_ERROR = 0;
INDEX_IS_NOT_READY = 1;
UNKNOWN_ERROR = 2;
}
repeated DocumentMatch matches = 1;
Error error = 2;
}
message SyncRequest {
oneof target {
int64 documentId = 1;
bool all = 2;
}
bool delete = 3;
}
message SyncResponse {
enum Error {
NO_ERROR = 0;
ANOTHER_SYNC_IN_PROGRESS = 1;
INDEX_IS_NOT_READY = 2;
UNKNOWN_ERROR = 3;
}
Error error = 1;
}
service Victor {
rpc FindTopKDocuments(TopKDocumentsRequest) returns (SearchResponse);
rpc FindDocumentsWithinDistance(DocumentsWithinDistanceRequest) returns (SearchResponse);
rpc Sync(SyncRequest) returns (SyncResponse);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment