Fix backward Elasticsearch pagination from a null cursor
What does this MR do and why?
Fix backward Elasticsearch pagination from a null cursor
pagination_filter_for_null_cursor emitted the same filter in both directions, restricting matches to documents whose sort field is missing. That is right going forward, where only the remaining null-sort documents follow the cursor, but wrong going backward: Elasticsearch sorts nulls last, so every document that has a sort value precedes the cursor and was being excluded. Paging back out of the null bucket returned a short page, or nothing at all.
Reachable today on any nullable sort served from Elasticsearch through Search::Elastic::Pagination
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.