Skip to content

Page navigation "previous" relΒ #439

@YuriZmytrakov

Description

@YuriZmytrakov

Is your feature request related to a problem? Please describe.
The previous relation is missing in page navigation, which prevents navigating in the opposite direction of the next rel.

Image

Describe the solution you'd like
Similar to stac-fastapi-pgstac, I tried generating the previous rel token, but it does not work by design. In zstac-fastapi-pgstacz, tokens are handled by PGStac (the database generates both prev and next tokens). When I tried a similar approach, I was unable to generate prev token.
As an alternative, I considered storing page links by stacking self rel from previous pages as previous rel, and keeping this variable in cache (or another mechanism) to enable custom page navigation. Unfortunately, according to the documentation, OpenSearch only supports next relations to navigate between pages:
https://docs.opensearch.org/latest/search-plugins/searching-data/paginate/

Solution from stac-fastapi-pgstac to get the links from PGStac:
https://github.com/stac-utils/stac-fastapi-pgstac/blob/f1b421556b2c4b82ea949783c04c6c3f38357d11/stac_fastapi/pgstac/core.py#L44

Additional context
I would appreciate your input on this feature, possible options to enhance page navigation, feasibility, and your opinion on whether this would be a valuable addition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions