It looks like the paging filters (take and limit) are applied to the base query before the directory projection is applied.
The net result is that when there are many harvest items, so much so, the first page only contains entries from one directory, only one directory result ends up being shown.
The paging needed to be applied after the directory query.
Repro: in a harvest with 317 files across three directories...
GET https://api.staging.ecosounds.org/harvests/25/items?page=1 returns
It looks like the paging filters (take and limit) are applied to the base query before the directory projection is applied.
The net result is that when there are many harvest items, so much so, the first page only contains entries from one directory, only one directory result ends up being shown.
The paging needed to be applied after the directory query.
Repro: in a harvest with 317 files across three directories...
GET https://api.staging.ecosounds.org/harvests/25/items?page=1
returnsWhereas
GET https://api.staging.ecosounds.org/harvests/25/items?page=2
returnsNeither of these results are correct. Also note: the paging values are incorrect.