Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prev_page field is always null on search #10349

Open
GuillaumeGomez opened this issue Jan 8, 2025 · 3 comments
Open

prev_page field is always null on search #10349

GuillaumeGomez opened this issue Jan 8, 2025 · 3 comments
Assignees
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@GuillaumeGomez
Copy link
Member

Current Behavior

prev_page is always null.

Expected Behavior

It should return the seek for the previous page if there is one.

Steps To Reproduce

You can see the issue on docs.rs:

Go to https://docs.rs/releases/search?query=sysinfo
Click "next page"

Then you can see that there is no "previous page" button. I originally suspected a bug on docs.rs side but after investigating, it looks like the ["api", "v1", "crates"] query always return a null prev_page in the JSON response.

Environment

No response

Anything else?

No response

@Turbo87
Copy link
Member

Turbo87 commented Jan 8, 2025

That's intended behavior. The way seek pagination is implemented we can't offer reverse traversal without sacrificing performance.

@GuillaumeGomez
Copy link
Member Author

I see. I suppose we can store the previous page in the cookie session... Gonna find something out.

@eth3lbert
Copy link
Contributor

That's intended behavior. The way seek pagination is implemented we can't offer reverse traversal without sacrificing performance.

I don't expect significant performance issues. It would only involve some reverse handling (including query and result processing). This is actually one of the enhancement items on my backlog.

@eth3lbert eth3lbert self-assigned this Jan 9, 2025
@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-backend ⚙️ labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

No branches or pull requests

3 participants