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
- HTTP2 support for higher performance connections to IBM Cloudant.
101
119
- Perform requests either synchronously or asynchronously.
102
120
- Instances of the client are unconditionally thread-safe.
@@ -1068,6 +1086,303 @@ public class Stop {
1068
1086
}
1069
1087
```
1070
1088
1089
+
### Pagination (beta)
1090
+
1091
+
#### Introduction
1092
+
1093
+
The pagination feature (currently beta) accepts options for a single operation and automatically
1094
+
creates the multiple requests to the server necessary to page through the results a fixed number at a time.
1095
+
1096
+
Pagination is a best-practice to break apart large queries into multiple server requests.
1097
+
This has a number of advantages:
1098
+
* Keeping requests within server imposed limits, for example
1099
+
*`200` max results for text search
1100
+
*`2000` max results for partitioned queries
1101
+
* Fetching only the necessary data, for example
1102
+
* User finds required result on first page, no need to continue fetching results
1103
+
* Reducing the duration of any individual query
1104
+
* Reduce risk of query timing out on the server
1105
+
* Reduce risk of network request timeouts
1106
+
1107
+
#### Limitations
1108
+
1109
+
Limitations of pagination:
1110
+
* Forward only, no backwards paging
1111
+
* Limitations on `_all_docs` and `_design_docs` operations
1112
+
* No pagination for `key` option.
1113
+
There is no need to paginate as IDs are unique and this returns only a single row.
1114
+
This is better achieved with a single document get request.
1115
+
* No pagination for `keys` option.
1116
+
* Limitations on `_view` operations
1117
+
* No pagination for `key` option. Pass the same `key` as a start and end key instead.
1118
+
* No pagination for `keys` option.
1119
+
* Views that emit multiple identical keys (with the same or different values)
1120
+
from the same document cannot paginate if those key rows with the same ID
1121
+
span a page boundary.
1122
+
The pagination feature detects this condition and an error occurs.
1123
+
It may be possible to workaround using a different page size.
1124
+
* Limitations on `_search` operations
1125
+
* No pagination of grouped results.
1126
+
* No pagination of faceted `counts` or `ranges` results.
1127
+
1128
+
#### Capacity considerations
1129
+
1130
+
Pagination can make many requests rapidly from a single program call.
1131
+
1132
+
For IBM Cloudant take care to ensure you have appropriate plan capacity
1133
+
in place to avoid consuming all the permitted requests.
1134
+
If there is no remaining plan allowance and retries are not enabled or insufficient
1135
+
then a `429 Too Many Requests` error occurs.
1136
+
1137
+
#### Available operations
1138
+
1139
+
Pagination is available for these operations:
1140
+
* Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=java#postalldocs)
1141
+
and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=java#postpartitionalldocs)
1142
+
*[Global all documents examples](https://github.com/IBM/cloudant-java-sdk/tree/v0.10.4/modules/examples/src/main/java/features/pagination/AllDocsPagination.java)
1143
+
*[Partitioned all documents examples](https://github.com/IBM/cloudant-java-sdk/tree/v0.10.4/modules/examples/src/main/java/features/pagination/PartitionAllDocsPagination.java)
1144
+
* Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=java#postdesigndocs)
0 commit comments