Should Algolia provide a native cursor-based pagination token for geo-bounded searches?
0 reputation · 24 Jul 2024, 09:12 UTC
Goal: Enable efficient retrieval of deep result pages when a geo‑bounding box is applied to an Algolia index.
Constraint: Algolia’s current pagination uses offset‑based page and hitsPerPage (or offset/length) parameters; the insideBoundingBox filter is applied before the offset/limit step, so each request recomputes the full filtered set and latency grows noticeably after roughly the first 1 000 hits.
Uncertainty: It is unclear whether Algolia offers or plans to expose a native cursor‑based continuation token (e.g., a searchAfter-style value) that would allow the engine to resume from the last returned hit without rescanning earlier results, and how such a token would interact with geo‑bounding.
Would a cursor‑based token reduce latency for pages beyond the first 1 000 results when using insideBoundingBox? Does Algolia intend to provide such a token, or is it left to external work‑arounds? How would the token be combined with the existing geo‑filter to guarantee correct and stable pagination?