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
Copy file name to clipboardExpand all lines: docs/general-development/pagination-for-large-result-sets.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ localization_priority: Priority
7
7
8
8
# Pagination for large result sets
9
9
10
-
If you have a large number of pages (for example, over 50,000) to page through in a query, it is recommended to use the approach explained in this article instead of the approach of [StartRow](https://docs.microsoft.com/sharepoint/dev/general-development/sharepoint-search-rest-api-overview#startrow). This approach uses sorting on `[docid]` in ascending order and uses a query restriction on the `IndexDocId` value with an increasing value of `IndexDocID` for each new page.
10
+
If you have a large number of search results (for example, over 50,000) to page through in a query, it is recommended to use the approach explained in this article instead of the approach of [StartRow](https://docs.microsoft.com/sharepoint/dev/general-development/sharepoint-search-rest-api-overview#startrow). This approach uses sorting on `[docid]` in ascending order and uses a query restriction on the `IndexDocId` value with an increasing value of `IndexDocID` for each new page.
11
11
12
12
The advantages of this approach are:
13
13
14
14
- It provides pagination with better performance
15
-
- It does not have a limit on the number of pages
15
+
- It does not have a limit on the number of pages (if you use the approach of [StartRow](https://docs.microsoft.com/sharepoint/dev/general-development/sharepoint-search-rest-api-overview#startrow) and the `StartRow` value is greater than 50,000, there is a risk of being throttled by SharePoint)
16
16
17
17
Here is an example of using this approach:
18
18
@@ -37,17 +37,17 @@ The result of this query should contain the following content:
37
37
...
38
38
```
39
39
40
-
Get the `DocId` value of the last entry in the result. You should be able to find `DocId` under `SP.SimpleDataRow`. Let's say the `DocId` value is `10`. We will use that as the `DocID` restriction for page 2:
40
+
Get the `DocId` value of the last entry in the result. You should be able to find `DocId` under `SP.SimpleDataRow`. Let's say the `DocId` value is `10`. You will use that as the `DocID` restriction for page 2:
41
41
42
-
For Page 2, we use the following query, where we continue using sortlist on `DocId` in ascending order, but also add an `IndexDocId` restriction:
42
+
For Page 2, use the following query, where you need to continue using sortlist on `DocId` in ascending order, but also add an `IndexDocId` restriction:
43
43
44
44
```http
45
45
GET http:// _server_/_api/search/query?querytext='sharepoint indexdocid>10'&sortlist='[docid]:ascending'
46
46
```
47
47
48
48
Let's say the `DocId` value of the last entry in the result is 20.
49
49
50
-
For Page 3, we continue the query with the same pattern as previous page:
50
+
For Page 3, continue the query with the same pattern as previous page:
51
51
52
52
```http
53
53
GET http:// _server_/_api/search/query?querytext='sharepoint indexdocid>20'&sortlist='[docid]:ascending'
0 commit comments