Skip to content

Commit 1de6266

Browse files
committed
Update pagination-for-large-result-sets.md
modified query example explanation
1 parent d16e56a commit 1de6266

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/general-development/pagination-for-large-result-sets.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ localization_priority: Priority
77

88
# Pagination for large result sets
99

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.
1111

1212
The advantages of this approach are:
1313

1414
- 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)
1616

1717
Here is an example of using this approach:
1818

@@ -37,17 +37,17 @@ The result of this query should contain the following content:
3737
...
3838
```
3939

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:
4141

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:
4343

4444
```http
4545
GET http:// _server_/_api/search/query?querytext='sharepoint indexdocid>10'&sortlist='[docid]:ascending'
4646
```
4747

4848
Let's say the `DocId` value of the last entry in the result is 20.
4949

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:
5151

5252
```http
5353
GET http:// _server_/_api/search/query?querytext='sharepoint indexdocid>20'&sortlist='[docid]:ascending'

0 commit comments

Comments
 (0)