Better, we could improve the API to use a different pagination mechanism and left the 10k result limit in the API. The current mechanism of next links is well-adapted to the recent search_after option in the ES search API (docs only exist for very recent versions, but I've tested it and it seems to work with our current ES version). If you have a stable sort in the API such that the sort value returned is not shared by several documents (this requires using a unique ID such as the UUID or recid as a tie-breaker), you can simply pass the value of the last score on the current page to search_after to get the next page, indefinitely. This seems compatible with the next API links (if treated as opaque URLs, so we could have ?next= instead of ?page=) that we return, so wouldn't break the API, but would probably require some work on invenio-records-rest.
Better, we could improve the API to use a different pagination mechanism and left the 10k result limit in the API. The current mechanism of next links is well-adapted to the recent search_after option in the ES search API (docs only exist for very recent versions, but I've tested it and it seems to work with our current ES version). If you have a stable sort in the API such that the sort value returned is not shared by several documents (this requires using a unique ID such as the UUID or recid as a tie-breaker), you can simply pass the value of the last score on the current page to search_after to get the next page, indefinitely. This seems compatible with the next API links (if treated as opaque URLs, so we could have ?next= instead of ?page=) that we return, so wouldn't break the API, but would probably require some work on invenio-records-rest.
Moved from: https://github.com/inspirehep/inspirehep/issues/2198