Vald Search APIs

Overview

Search Service is responsible for searching vectors similar to the user request vector from vald-agent.

service Search {
+  rpc Search(payload.v1.Search.Request) returns (payload.v1.Search.Response) {}
+
+  rpc SearchByID(payload.v1.Search.IDRequest)
+      returns (payload.v1.Search.Response) {}
+
+  rpc StreamSearch(stream payload.v1.Search.Request)
+      returns (stream payload.v1.Search.StreamResponse) {}
+
+  rpc StreamSearchByID(stream payload.v1.Search.IDRequest)
+      returns (stream payload.v1.Search.StreamResponse) {}
+
+  rpc MultiSearch(payload.v1.Search.MultiRequest)
+      returns (payload.v1.Search.Responses) {}
+
+  rpc MultiSearchByID(payload.v1.Search.MultiIDRequest)
+      returns (payload.v1.Search.Responses) {}
+
+  rpc LinearSearch(payload.v1.Search.Request) returns (payload.v1.Search.Response) {}
+
+  rpc LinearSearchByID(payload.v1.Search.IDRequest)
+      returns (payload.v1.Search.Response) {}
+
+  rpc StreamLinearSearch(stream payload.v1.Search.Request)
+      returns (stream payload.v1.Search.StreamResponse) {}
+
+  rpc StreamLinearSearchByID(stream payload.v1.Search.IDRequest)
+      returns (stream payload.v1.Search.StreamResponse) {}
+
+  rpc MultiLinearSearch(payload.v1.Search.MultiRequest)
+      returns (payload.v1.Search.Responses) {}
+
+  rpc MultiLinearSearchByID(payload.v1.Search.MultiIDRequest)
+      returns (payload.v1.Search.Responses) {}
+}
+

Search RPC

Search RPC is the method to search vector(s) similar to the request vector.

Input

  • the scheme of payload.v1.Search.Request

    message Search {
    +  message Request {
    +    repeated float vector = 1 [ (validate.rules).repeated .min_items = 2 ];
    +    Config config = 2;
    +  }
    +
    +  message Config {
    +    string request_id = 1;
    +    uint32 num = 2 [ (validate.rules).uint32.gte = 1 ];
    +    float radius = 3;
    +    float epsilon = 4;
    +    int64 timeout = 5;
    +    Filter.Config ingress_filters = 6;
    +    Filter.Config egress_filters = 7;
    +    uint32 min_num = 8;
    +    AggregationAlgorithm aggregation_algorithm = 9;
    +  }
    +}
    +
    +enum AggregationAlgorithm {
    +  Unknown = 0;
    +  ConcurrentQueue = 1;
    +  SortSlice = 2;
    +  SortPoolSlice = 3;
    +  PairingHeap = 4;
    +}
    +
    • Search.Request