You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: open-api.yaml
+23-7Lines changed: 23 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,14 @@ components:
29
29
type: integer
30
30
description: Limit given for the query. If limit is not provided as a query parameter, this parameter displays the default limit value.
31
31
example: 10
32
-
after:
32
+
from:
33
33
type: integer
34
-
description: Represents identifier to fetch the next slice of the results. The first item identifier for the next slice starts at `after+1`.
34
+
description: The first task uid returned.
35
35
example: 999
36
+
next:
37
+
type: integer
38
+
description: Represents the value to send in `from` to fetch the next slice of the results. The first item for the next slice starts at this exact number. When the returned value is null, it means that all the data have been browsed in the given order.
39
+
example: 989
36
40
timestamp:
37
41
type: string
38
42
description: An `RFC 3339` format for date/time/duration.
@@ -699,6 +703,12 @@ components:
699
703
schema:
700
704
type: number
701
705
default: 0
706
+
from:
707
+
name: from
708
+
in: query
709
+
description: Fetch the next set of results from the given uid.
Copy file name to clipboardExpand all lines: text/0060-tasks-api.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -572,15 +572,15 @@ New task types are also added for these operations. `indexCreation`, `indexUpdat
572
572
573
573
The API endpoints `/tasks` and `indexes/{indexUid}/tasks` are browsable using a keyset based pagination.
574
574
575
-
##### 9.1 Why a keyset based pagination?
575
+
##### 9.1 Why a Seek/Keyset based pagination?
576
576
577
577
Keyset-based pagination is more appropriate when the data can grow or shrink quickly in terms of magnitude.
578
578
579
579
###### 9.1.1 Pros
580
580
581
581
The performance is better than the not-so-good but old pagination with `offset`/`limit`.
582
582
583
-
Cursor pagination keeps the results consistent between each page as the data evolves. It avoids the [Page Drift effect](https://use-the-index-luke.com/sql/partial-results/fetch-next-page), especially when the data is sorted from the most recent to the oldest.
583
+
Seek/Keyset pagination keeps the results consistent between each page as the data evolves. It avoids the [Page Drift effect](https://use-the-index-luke.com/sql/partial-results/fetch-next-page), especially when the data is sorted from the most recent to the oldest.
584
584
585
585
Moreover, the performance is superior to traditional pagination since the computational complexity remains constant to reach the identifier marking the beginning of the new slice to be returned from a hash table.
586
586
@@ -594,7 +594,7 @@ The main drawback of this type of pagination is that it does not navigate within
| next | integer - nullable | Represents the query parameter to send to fetch the next slice of the results. The first item for the next slice starts at this exact number. When the returned value is null, it means that all the data have been browsed in the given order. |
597
+
| next | integer - nullable | Represents the value to send in `from` to fetch the next slice of the results. The first item for the next slice starts at this exact number. When the returned value is null, it means that all the data have been browsed in the given order. |
598
598
599
599
##### 9.3 GET query parameters
600
600
@@ -663,7 +663,7 @@ This part demonstrates keyset paging in action on `/tasks`, but it should be equ
663
663
}
664
664
```
665
665
666
-
**End of cursor pagination**
666
+
**End of seek/keyset pagination**
667
667
668
668
`GET` - `/tasks?from=20`
669
669
@@ -702,6 +702,11 @@ This part demonstrates keyset paging in action on `/tasks`, but it should be equ
702
702
703
703
- If `from` is set with an out of bounds task `uid`, the response returns the tasks that are the nearest to the specified uid, the `next` field is set to the next page. It will be equivalent to call the `/tasks` route without any parameter.
704
704
705
+
###### 9.5.3 Errors
706
+
707
+
- 🔴 Sending a value with a different type than `Integer` for `limit` returns a [bad_request](0061-error-format-and-definitions.md#bad_request) error.
708
+
- 🔴 Sending a value with a different type than `Integer` for `from` returns a [bad_request](0061-error-format-and-definitions.md#bad_request) error.
0 commit comments