Skip to content

CQL filter returns wrong numberMatched after the first page of response #1182

@EleniLouvari

Description

@EleniLouvari

When using POST /search with filter-lang: cql2-json and paginating via the returned rel=next link, the first page reports the correct numberMatched, but subsequent pages report numberMatched equal to the total number of records in the catalog (ignoring the filter).

This breaks pagination UX and makes clients think the filtered result set is much larger than it is.

Example tested:

POST https://catalogue.ax3hub.xxxxx/search
{
  "filter-lang": "cql2-json",
  "filter": { 
   "op": "and",
    "args": [
      {
        "op": "=",
        "args": [
          {
            "property": "parentidentifier"
          },
          "ARD_S3"
        ]
      }
    ]
  },
  "limit": 10}
Page 1: numberMatched=268, numberReturned=10, features=10, rels=['self', 'first', 'next', 'root']
Next Page: https://catalogue.ax3hub-qa.planetek.gr/stac/search?limit=10&offset=10
Page 2: numberMatched=8001, numberReturned=10, features=10, rels=['self', 'prev', 'next', 'root']
Next Page: https://catalogue.ax3hub-qa.planetek.gr/stac/search?limit=10&offset=20
Page 3: numberMatched=8001, numberReturned=10, features=10, rels=['self', 'prev', 'next', 'root']
.....

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions