Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[records] sort by updated #1033

Open
pvgenuchten opened this issue Oct 17, 2024 · 0 comments
Open

[records] sort by updated #1033

pvgenuchten opened this issue Oct 17, 2024 · 0 comments

Comments

@pvgenuchten
Copy link
Contributor

pvgenuchten commented Oct 17, 2024

Description

When sorting on '-updated' on ogcapi-records, a random order is returned, maybe due to a combination of sorting on modification_date and date_revision or date?

On demo the effect is less obvious because only 2 dates exist, but
https://demo.pycsw.org/gisdata/collections/metadata:main/items?sortby=-updated&offset=100 returns same order as https://demo.pycsw.org/gisdata/collections/metadata:main/items?sortby=updated&offset=100

Steps to Reproduce

load some data with various dates populated, oreder by updated

Additional Information

relevant code seems

'updated': self.dataset.insert_date,

insert-date is the same for most of my content, because i imported all records at a single moment, expected would be that the modified-date of the metadata record itself was used (or if empty, insert-date), this logic is also applied in
record_dict['properties']['updated'] = record.date_modified
, which explains the difference

the problem here is that date-modified is not always populated, can we populate it at insert if nill?

alternative solution display dataset date and order by dataset date (which is usually more relevant, but not always populated)

see #365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant