Pagination issue in Identity Now

Hi
I am am not able to fetch more than 10,000 users from search API and getting below error please help me in resolving the error
QUERY:-
POST-https://{tenant}.api.identitynow.com/v3/search?limit=500&offset=10000
Error:-
{
“detailCode”: “500.1 Downstream error”,
“trackingId”: “b6fc52e0a83246ddbfa8589be6aff320”,
“messages”: [
{
“locale”: “en-US”,
“localeOrigin”: “DEFAULT”,
“text”: “Elastic execution error: {"caused_by":{"reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [10100]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.","caused_by":{"reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [10100]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."}}}.”
}
],
“causes”:
}

Thanks,
Divya

Hi Divya,

For very large searches, instead of using “count” and “offset”, use “sort” and “searchAfter”

e.g., sort by uid and then for each page pass in the last uid value into “searchAfter”

More info here:

Regards,
Ramiro