GenSpectrum / LAPIS

An API, a query engine, and a database schema for genomic sequences; currently with a focus on SARS-CoV-2
https://lapis-three.vercel.app
GNU Affero General Public License v3.0
21 stars 6 forks source link

Limit and order by are behaving strangely #572

Closed chaoran-chen closed 9 months ago

chaoran-chen commented 9 months ago

I am getting strange results when using limit and orderBy together when I call the details endpoint (I haven't tested other endpoints). Sorting by country in descending order with limit 10 gives me Zimbabwe - that makes sense.

Request

curl -X 'POST' \
  'https://s1.int.genspectrum.org/open/sample/details' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "orderBy": [
    {
      "field": "country",
      "type": "descending"
    }
  ],
  "limit": 10,
  "fields": [
    "country"
  ]
}'

But if I set limit to 100, I only get Vietnam, no mention of Zimbabwe.

Request

curl -X 'POST' \
  'https://s1.int.genspectrum.org/open/sample/details' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "orderBy": [
    {
      "field": "country",
      "type": "descending"
    }
  ],
  "limit": 100,
  "fields": [
    "country"
  ]
}'

I am creating this issue in LAPIS because I only directly tested LAPIS but maybe it's actually a problem in SILO?

fengelniederhammer commented 9 months ago

We only pass on limit and offset to SILO, so this needs to be fixed in SILO. @Taepper