Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/seqapi/v1/seq_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ message SearchRequest {
bool with_total = 7;
repeated AggregationQuery aggregations = 8;
Order order = 9;
string offset_id = 10;
}

message SearchResponse {
Expand Down
4 changes: 4 additions & 0 deletions internal/api/seqapi/v1/grpc/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func (a *API) Search(ctx context.Context, req *seqapi.SearchRequest) (*seqapi.Se
Key: "order",
Value: attribute.StringValue(req.GetOrder().String()),
},
{
Key: "offset_id",
Value: attribute.StringValue(req.GetOffsetId()),
},
}

if env != "" {
Expand Down
8 changes: 7 additions & 1 deletion internal/api/seqapi/v1/http/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func (a *API) serveSearch(w http.ResponseWriter, r *http.Request) {
Key: "order",
Value: attribute.StringValue(string(httpReq.Order)),
},
{
Key: "offset_id",
Value: attribute.StringValue(httpReq.OffsetID),
},
}

if env != "" {
Expand Down Expand Up @@ -163,7 +167,8 @@ type searchRequest struct {
Histogram struct {
Interval string `json:"interval"`
} `json:"histogram"`
Order order `json:"order" default:"desc"`
Order order `json:"order" default:"desc"`
OffsetID string `json:"offset_id"`
} // @name seqapi.v1.SearchRequest

func (r searchRequest) toProto() *seqapi.SearchRequest {
Expand All @@ -173,6 +178,7 @@ func (r searchRequest) toProto() *seqapi.SearchRequest {
To: timestamppb.New(r.To),
Limit: r.Limit,
Offset: r.Offset,
OffsetId: r.OffsetID,
WithTotal: r.WithTotal,
Aggregations: r.Aggregations.toProto(),
Order: r.Order.toProto(),
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/client/seqdb/grpc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func newProxySearchReq(req *seqapi.SearchRequest) *seqproxyapi.ComplexSearchRequ
Aggs: newProxyAggQuerySlice(req.Aggregations),
Size: int64(req.Limit),
Offset: int64(req.Offset),
OffsetId: req.OffsetId,
WithTotal: req.WithTotal,
Order: seqproxyapi.Order(req.Order),
}
Expand Down
720 changes: 370 additions & 350 deletions internal/pkg/client/seqdb/seqproxyapi/v1/seq_proxy_api.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions internal/pkg/client/seqdb/seqproxyapi/v1/seq_proxy_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ message SearchRequest {
int64 offset = 3; // Search offset.
bool with_total = 4; // Should total number of documents be returned in response.
Order order = 5; // Document order ORDER_DESC/ORDER_ASC.
string offset_id = 6; // ID offset for pagination.
}

message ComplexSearchRequest {
Expand All @@ -155,6 +156,7 @@ message ComplexSearchRequest {
int64 offset = 5; // Search offset.
bool with_total = 6; // Should total number of documents be returned in response.
Order order = 7; // Document order ORDER_DESC/ORDER_ASC.
string offset_id = 8; // ID offset for pagination.
}

message SearchResponse {
Expand Down
886 changes: 448 additions & 438 deletions pkg/seqapi/v1/seq_api.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2853,6 +2853,9 @@
"type": "integer",
"format": "int32"
},
"offset_id": {
"type": "string"
},
"order": {
"default": "desc",
"allOf": [
Expand Down
Loading