-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi, when the same item (with the same ID) exists in two collections, the /search endpoint without limit parameter returns the expected result = all items from all collections.
But when we add a limit parameter, the /search endpoint fails: it returns only items from the first collection, with a 'next' link that should allow to get items from the next collections, but this 'next' link doesn't work: it returns nothing. The "previous" link is invalid also.
I have implemented this pytest to demonstrate this: https://github.com/stac-utils/stac-fastapi-pgstac/pull/314/files
It starts by saving 2 items in one or two collections, depending on the use case. Then it calls /search with limit=1
In a nominal use case the log shows:
page: 1
previous url: None
next url: http://test/search?limit=1&token=next%3Atest-collection%3Atest_item2
numberReturned: 1
returned feature: test-collection:test_item2
page: 2
previous url: http://test/search?limit=1&token=prev%3Atest-collection%3Atest-item
next url: None
numberReturned: 1
returned feature: test-collection:test-item
PASSED
In the KO use case:
page: 1
previous url: None
next url: http://test/search?limit=1&token=next%3Atest-collection%3Atest-item # follow this to get to page 2
numberReturned: 1
returned feature: test-collection:test-item
page: 2
previous url: http://test/search?limit=1&token=prev%3A%3A # the previous link is invalid
next url: None
numberReturned: 0 # the page 2 returned no features
FAILED
vprivat-ads and jonhealy1
Metadata
Metadata
Assignees
Labels
No labels