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

Dates not sorting full string #973

Open
6 tasks
ndroark opened this issue Feb 20, 2024 · 4 comments
Open
6 tasks

Dates not sorting full string #973

ndroark opened this issue Feb 20, 2024 · 4 comments
Assignees
Labels
Contribute Back maintenance bills to maintenance

Comments

@ndroark
Copy link
Collaborator

ndroark commented Feb 20, 2024

Summary

In some cases, dates in the Date Created field fomatted as yyyy-mm-dd are only sorting by part of the string. Example here: https://wabash.hykucommons.org/collections/d4efac9d-24d2-472e-85cd-1c7da1319ccd?utf8=%E2%9C%93&sort=date_ssi+desc&per_page=10&locale=en

Relevant Slack thread: https://assaydepot.slack.com/archives/C0313NKC08L/p1708455332886429

Acceptance Criteria

  • Date Created field is sorted by its entire string

Testing Instructions

  • Create two works
  • Put the dates as something like 2009-10-01 and the other 2009-09-01
  • Add them to a collection
  • Go to the collection show page and sort the works by date created
  • Observe that the dates sort correctly
@ndroark ndroark converted this from a draft issue Feb 20, 2024
@ndroark ndroark added the maintenance bills to maintenance label Feb 20, 2024
@kirkkwang kirkkwang self-assigned this Mar 7, 2024
kirkkwang added a commit that referenced this issue Mar 7, 2024
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 moved this from Ready for Development to Code Review in palni-palci Mar 7, 2024
kirkkwang added a commit that referenced this issue Mar 7, 2024
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 added a commit that referenced this issue Mar 7, 2024
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
@ShanaLMoore ShanaLMoore moved this from Code Review to Deploy to Staging in palni-palci Mar 7, 2024
@laritakr laritakr moved this from Deploy to Staging to SoftServ QA in palni-palci Mar 8, 2024
@jillpe
Copy link

jillpe commented Mar 11, 2024

SoftServ QA: ✅

It did sort the works correctly via the date created. Work 1 973's created date was 2009-10-01. #973 Work 2 SoftServ QA's created date was 2009-09-01

Collection created for QA

Image

Image

@jillpe jillpe moved this from SoftServ QA to PALs QA in palni-palci Mar 11, 2024
@ndroark ndroark moved this from PALs QA to Deploy to Production in palni-palci Mar 13, 2024
@jillpe jillpe moved this from Deploy to Production to Client Verification in palni-palci Mar 18, 2024
@ndroark
Copy link
Collaborator Author

ndroark commented Mar 19, 2024

In this collection (https://wabash.hykucommons.org/collections/d4efac9d-24d2-472e-85cd-1c7da1319ccd?utf8=%E2%9C%93&sort=date_ssi+desc&per_page=10&locale=en), works with properly structured dates are still sorting the days out of order.

Image

@jillpe jillpe moved this from Client Verification to Ready for Development in palni-palci Mar 19, 2024
@laritakr
Copy link
Contributor

The reindex did not complete correctly.

second = SolrDocument.find('1e392dac-37de-4d57-aa40-83020bbae320')
irb(main):008:0> second['date_ssi']
=> "2001"

GenericWork.find(second.id).update_index
irb(main):013:0> second['date_ssi']
=> "2001-01-18"

@ShanaLMoore ShanaLMoore moved this from Ready for Development to Client Verification in palni-palci Mar 20, 2024
@ShanaLMoore ShanaLMoore moved this from Client Verification to SoftServ QA in palni-palci Mar 20, 2024
@jillpe jillpe moved this from SoftServ QA to Client Verification in palni-palci Mar 20, 2024
@ShanaLMoore
Copy link
Contributor

We reindex the collection of concern and see the issue got resolved so perhaps there were some issues when we reindexed before. We will need to run another reindex over the weekend.

@ndroark ndroark moved this from Client Verification to Done in palni-palci Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribute Back maintenance bills to maintenance
Projects
Status: Done
Development

No branches or pull requests

5 participants