Add an initial version of a search service.

It's still incomplete and isn't working yet.
This commit is contained in:
André Duffeck
2022-04-08 10:53:37 +02:00
parent c3f8d837bd
commit 3099d4a821
35 changed files with 2196 additions and 0 deletions
@@ -0,0 +1,16 @@
syntax = "proto3";
package ocis.messages.search.v0;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/messages/search/v0";
message Match {
// key of the recorda
string key = 1;
// value in the record
bytes value = 2;
// time.Duration (signed int64 nanoseconds)
int64 expiry = 3;
// the associated metadata
map<string,Field> metadata = 4;
}
@@ -0,0 +1,84 @@
syntax = "proto3";
package ocis.services.search.v0;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/service/search/v0";
import "ocis/messages/search/v0/search.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "cs3/storage/provider/v1beta1/resources.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "ownCloud Infinite Scale search";
version: "1.0.0";
contact: {
name: "ownCloud GmbH";
url: "https://github.com/owncloud/ocis";
email: "support@owncloud.com";
};
license: {
name: "Apache-2.0";
url: "https://github.com/owncloud/ocis/blob/master/LICENSE";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "https://owncloud.dev/extensions/search/";
};
};
service SearchProvider {
rpc Search(SearchRequest) returns (SearchResponse) {};
}
service IndexProvider {
rpc Search(SearchIndexRequest) returns (SearchIndexResponse) {};
rpc Index(IndexRequest) returns (IndexResponse) {};
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];
// Optional. Used to specify a subset of fields that should be
// returned by a get operation or modified by an update operation.
google.protobuf.FieldMask field_mask = 3;
string query = 4;
}
message SearchResponse {
repeated ocis.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;
}
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];
// Optional. Used to specify a subset of fields that should be
// returned by a get operation or modified by an update operation.
google.protobuf.FieldMask field_mask = 3;
string query = 4;
string
}
message SearchIndexResponse {
repeated ocis.messages.search.v0.Record records = 1;
}