Files
komp_ac/common/proto/search.proto
2026-07-16 14:38:12 +02:00

54 lines
1.1 KiB
Protocol Buffer

// In common/proto/search.proto
syntax = "proto3";
package komp_ac.search;
service Searcher {
rpc Search(SearchRequest) returns (SearchResponse);
}
enum MatchMode {
MATCH_MODE_UNSPECIFIED = 0;
MATCH_MODE_FUZZY = 1;
MATCH_MODE_EXACT = 2;
}
message ColumnConstraint {
string column = 1;
string query = 2;
MatchMode mode = 3;
}
message SearchRequest {
string profile_name = 1;
optional string table_name = 2;
string free_query = 3;
repeated ColumnConstraint must = 4;
optional uint32 limit = 5;
optional uint32 offset = 6;
optional SearchOrder order = 7;
}
message SearchOrder {
string column = 1;
SearchOrderDirection direction = 2;
}
enum SearchOrderDirection {
SEARCH_ORDER_DIRECTION_UNSPECIFIED = 0;
SEARCH_ORDER_DIRECTION_ASC = 1;
SEARCH_ORDER_DIRECTION_DESC = 2;
}
message SearchResponse {
message Hit {
int64 id = 1; // PostgreSQL row ID
float score = 2;
string content_json = 3;
string table_name = 4;
// Configured human-readable value for this row.
string row_display_value = 5;
string row_display_column = 6;
optional uint64 position = 7;
}
repeated Hit hits = 1;
}