Skip to content

is it possible to do server-side sort by non-item domain fields? #299

@ukostas

Description

@ukostas

I am trying to get top 10 most downloaded artifacts. I want to do all sorting part by server to reduce amount of data transferred to client.
My first guess is following spec file (top 10 most downloaded):

{
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "repo-name"
        }
      },
      "sortBy": "stat.downloads",
      "sortOrder": "desc",
      "limit": 10
    }
  ]
}

which does not work - got 10 files not sorted by "stat.downloaded". After reading limitations of sort in AQL I got a feeling that this is not possible - stat field is not a domain field of item hence sort won't work on server side.

My question is: is it possible to to do such server-side sorting - via API / CLI / Spec file ?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions