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

Unification: Package search result pagination #1462

Open
lucasgarfield opened this issue Aug 2, 2022 · 3 comments
Open

Unification: Package search result pagination #1462

lucasgarfield opened this issue Aug 2, 2022 · 3 comments
Assignees

Comments

@lucasgarfield
Copy link
Collaborator

We would like to eliminate pagination from the package search feature. This would allow us to perform our own (better) sorting logic similar to what is done in Image Builder Front End.

Currently, searching for packages is done by calling the Weldr API, which supports* pagination. *In a sense it requires pagination. On my machine, requests for > ~1000 packages fail.

Therefore, changes to the Weldr API are probably necessary to implement this effectively as fetching the full package list would require a very large number of API calls (consider that Fedora has ~35k packages).

@teg
Copy link
Member

teg commented Aug 2, 2022

This is related to a comment I made on your PR: I think we should consider doing the searching and pagination in dnf-json. Then we have the logic in one place and pass up the minimal amount of data (I didn't measure, but dumping the whole package database over json for every search as we do now in composer is probably sub optimal).

@bcl
Copy link
Collaborator

bcl commented Aug 3, 2022

Therefore, changes to the Weldr API are probably necessary to implement this effectively as fetching the full package list would require a very large number of API calls (consider that Fedora has ~35k packages).

FWIW it only requires two, but yes it's a giant amount of data. eg. If you look at the output from composer-cli --json packages list it does an initial request with the limit set to 0 to get the total number of projects:

{
    "method": "GET",
    "path": "/projects/list?limit=0",
    "status": 200,
    "body": {
        "limit": 0,
        "offset": 0,
        "projects": [],
        "total": 6829
    }
}

And then requests all of them in one query with limit set to the total count:

{
    "method": "GET",
    "path": "/projects/list?limit=6829",
    "status": 200,
    "body": {
        "limit": 6829,
        "offset": 0,
        "projects": [
            {

...

It would be much more efficient to implement the searching on the server side like Tom suggests.

@jkozol
Copy link
Collaborator

jkozol commented Jan 30, 2023

@lucasgarfield Any additional information about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants