syntax = "proto3"; package qsfera.services.search.v0; option go_package = "github.com/qsfera/server/protogen/gen/qsfera/service/search/v0"; import "qsfera/messages/search/v0/search.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/annotations.proto"; import "google/protobuf/field_mask.proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { title: "КуСфера search"; version: "1.0.0"; contact: { name: "КуСфера"; url: ""; email: ""; }; license: { name: "Apache-2.0"; url: ""; }; }; schemes: HTTP; schemes: HTTPS; consumes: "application/json"; produces: "application/json"; external_docs: { description: "Developer Manual"; url: ""; }; }; service SearchProvider { rpc Search(SearchRequest) returns (SearchResponse) { option (google.api.http) = { post: "/api/v0/search/search", body: "*" }; }; rpc IndexSpace(IndexSpaceRequest) returns (IndexSpaceResponse) { option (google.api.http) = { post: "/api/v0/search/index-space", body: "*" }; } } service IndexProvider { rpc Search(SearchIndexRequest) returns (SearchIndexResponse) { option (google.api.http) = { post: "/api/v0/search/index/search", body: "*" }; }; // rpc Remove(RemoveRequest) returns (RemoveResponse) {}; } message SearchRequest { // Optional. The maximum number of entries to return in the response int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pagination token returned from a previous call to `Get` // that indicates from where search should continue string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; string query = 3; qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL]; } message SearchResponse { repeated qsfera.messages.search.v0.Match matches = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list string next_page_token = 2; int32 total_matches = 3; } message SearchIndexRequest { // Optional. The maximum number of entries to return in the response int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pagination token returned from a previous call to `Get` // that indicates from where search should continue string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; string query = 3; qsfera.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL]; } message SearchIndexResponse { repeated qsfera.messages.search.v0.Match matches = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list string next_page_token = 2; int32 total_matches = 3; } message IndexSpaceRequest { string space_id = 1; string user_id = 2; bool force_reindex = 3; } message IndexSpaceResponse { }