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

🐛 Fix date indexing to return more than YYYY #985

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

kirkkwang
Copy link
Contributor

Story

Prior to this commit when the date_created property was indexed, only the year was indexed. If the input was something like "2024-01-01" then date_ssi would only be "2024". This commit will index YYYY-MM-DD, YYYY-MM, and YYYY if given. Anything other than those three formats will be indexed as is and won't work correctly with sorting or range queries.

Ref:

Expected Behavior Before Changes

YYYY-MM-DD, YYYY-MM, and YYYY dates were indexed just as YYYY.

Expected Behavior After Changes

YYYY-MM-DD, YYYY-MM, and YYYY dates are indexes as YYYY-MM-DD, YYYY-MM, and YYYY respectively.

app/indexers/app_indexer.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@jeremyf jeremyf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

Prior to this commit when the date_created property was indexed, only
the year was indexed.  If the input was something like "2024-01-01" then
`date_ssi` would only be "2024".  This commit will index YYYY-MM-DD,
YYYY-MM, and YYYY if given.  Anything other than those three formats
will be indexed as is and won't work correctly with sorting or range
queries.

Ref:
  - #973
@kirkkwang kirkkwang merged commit c9f6070 into main Mar 7, 2024
6 of 7 checks passed
@kirkkwang kirkkwang deleted the i973-date-sorting branch March 7, 2024 18:12
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

Successfully merging this pull request may close these issues.

2 participants