Sorting and paging
Sorting
The sort parameter accepts a comma-separated list of field:direction pairs. The default sort is relevance:desc.
Sort fields
| Field | Description |
|---|---|
relevance | Search relevance score (default) |
Direction is asc or desc (case-insensitive).
Examples
- Sort by relevance, descending:
/v4/datasources?search=repository&sort=relevance:desc
Paging
V4 supports two pagination modes: offset-based and cursor-based.
Offset-based paging
Use page and page_size to retrieve a specific slice of results. Page numbering starts from 1.
/v4/datasources?filter=country:GR&page=3&page_size=25
Response:
{
"header": {
"numFound": 1520,
"maxScore": 1.0,
"queryTime": 15,
"page": 3,
"pageSize": 25
},
"results": [
...
]
}
Offset-based paging is limited to the first 10,000 results (page × page_size ≤ 10,000). For larger datasets, use cursor-based paging.
Cursor-based paging
Cursor pagination uses an opaque token to iterate through the full result set with no offset limit. Start with cursor=*, then use the nextCursor value from the response to fetch subsequent pages.
First request:
/v4/datasources?filter=country:GR&page_size=100&cursor=*
Response:
{
"header": {
"numFound": 1520,
"maxScore": 1.0,
"queryTime": 12,
"pageSize": 100,
"nextCursor": "AoE/D2M2NGU1YjVkNTQ4Nzo6..."
},
"results": [
...
]
}
Next request — use the nextCursor value:
/v4/datasources?filter=country:GR&page_size=100&cursor=AoE/D2M2NGU1YjVkNTQ4Nzo6...
Repeat until nextCursor matches the current cursor or is absent (no more results).
page and cursor cannot be used together. If cursor is provided, page is ignored.