-
Notifications
You must be signed in to change notification settings - Fork 0
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 "Sort by: Published Date" #185
Comments
This was done in pals for a different date (date created) |
Folks, the Sort By feature isn't working at all on a collection right now. When I created this ticket, we didn't have Knapsack. We are post Knapsack now, so I can't be sure if the cut over is responsible for the lack of functionality or if I overlooked and failed to test the other sort by options. Maybe it was always broken. Here's the collection where I'm having trouble: Automatic relevance sort (which isn't sorted by any metric that I can determine): I select "Sort By: Upload Date (Descending)" and hit Refresh and this is what I get: I select "Sort By: Title" and hit Refresh and this is what I get: |
Sorting does work (you have to hit refresh after making change) but sort by title is backward and sort by dates could not be verified easily. Need to look at those |
This was fixed in UTK |
This commit fixes a bug in the ability to sort works by "Published date", "Upload date", and "Title" in the catalog search page and the collection show page. Ref: - notch8/adventist_knapsack#185
This commit fixes a bug in the ability to sort works by "Published date", "Upload date", and "Title" on the catalog search page and the collection show page. Ref: - notch8/adventist_knapsack#185
This commit adds a guard clause to the `SortTitle` model to fix failing tests due to a nil value being assigned to `@title` on initialization. Ref: - notch8/adventist_knapsack#185
We identified the source of the sorting problem is coming from Hyku. We are making the changes there first. |
This commit pulls in an update to Hyku that fixes a bug when sorting by title, author, and created date (published date). The Hyku indexing moves from `CollectionResource` to `CollectionResourceIndexer`. Ref: - #185
This commit moves the HykuIndexing module from the CollectionResource to the CollectionResourceIndexer. Ref: - notch8/adventist_knapsack#185
|
# Story The "Sort by Published Date" (both ascending and descending) feature in the catalog search and in collections does not properly sort based on the "Publication date" metadata field. Ref: - #185 # Expected Behavior Before Changes Title, author, and publication date sort fields did not sort properly on the catalog search results page or the collection show page. # Expected Behavior After Changes The user is able to sort by title, author, and publication date on the catalog search results page as well as the collection show page. # Screenshots / Video https://github.com/user-attachments/assets/23ca2643-f0f4-498f-91b3-2ccc2b5e9714 # Notes This updated required an update of the submodule as well as reindexing local works and collections.
QA Results: ❌ NEEDS REWORKTLDR: sort by published date doesn't appear to be working for Collections. Kirk ran a staging reindex yesterday and in the tested example, I manually edit/saved each work to be sure it's not an indexing problem. tested on STAGING Testing note: the staging site was partially reindexed resulting in most existing records being updated but not all. Our assumption is that the cut over will handle the update of all works in production. Most records will pass QA. CATALOG INDEX PAGE ✅
COLLECTION PAGE ❌tested on STAGING
|
Team, as you're fixing this ticket, can you also educate me on which date field is used for the Sort By Published Date feature? There are so many date fields and they vary between work types. I have never been clear on which field maps to this feature, so your insight will be valuable. |
cc @sjproctor could you provide some insight here? ^^ |
Yeah, there are definitely a lot of date fields! We are using the |
This shows as "Date Created" on the work's metadata. The input form uses a calendar entry that puts a date into |
@laritakr Thank you! These are the instructions I needed. I've tried to find out before which field and which format the system prefers. The answer wasn't available when I asked the last couple times, so this is really great. I understand why the sort won't work unless we make revisions. We can default to mm/dd/yyyy, but (in case the community ever sits down to think about this) I would love to see modifications in future versions that allow for ISO standard dates, since mm/dd/yyyy is confusing across international boundaries. Well, forget that for now, and thank you again! |
You're welcome! Glad I could add clarity. Based on what I have found, I am moving this ticket back to QA. As an added note, I found that anything with no created date will sort at the end, whether using ascending OR descending. We could put in some date standardization as we index the date used for sorting. This would require a reindex of all works & collections. If this is a desired change, you would need to make a ticket for it. |
QA Results: ✅ Passed(previously passed catalog view QA) COLLECTION PAGE ✅tested on STAGING Created Dates were added to several works - I added the dates into the title so the results are obvious.
|
Yes, date_created is also used to build the sorted date. It expects the date_created to be in the format yyyy-mm-dd to extract the year to be used for sorting. |
I tested this ticket with a set of works (see importer) deposited into a single collection. I put date metadata into the date_created column of the CSV. The final version metadata CSV is attached to that importer. When I formatted dates as 5/1/2023, 5/2/2023, 5/3/2023 and so on, the sort by date feature did NOT work. However, when I entered just the year, the sort worked and put works in the expected order. So, the feature works as described earlier in this ticket. I tested the sort on the collection dashboard page, the public show page, and in the catalog search. |
Summary
The "Sort by Published Date" (both ascending and descending) feature in the catalog search and in collections does not properly sort based on the "Publication date" metadata field. If this feature is sorting based on a different date field, perhaps that would explain the problem, but if so, then we still would request work on this ticket, as explained in the last paragraph.
If the feature is meant to sort based on the "Publication date" metadata field, then we'd like the functionality to work when dates are entered in that field according to the system's requirements. In this example collection on ADL staging, we used the UI to enter publication date metadata, so we assume the system entered the date in a format that it prefers to read. The back end gave us a calendar widget, which we used. The dates appear properly in each work's metadata. However, when we use the sort by published date feature in the collection, the works do not sort in date order. See screenshots below.
Acceptance Criteria
Catalog search
Collection show pg (admin view)
Screenshots or Video
Proper date in work metadata:
https://adl.s2.adventistdigitallibrary.org/concern/published_works/22255888_the_minnesota_worker_december_21_1898?locale=en
Automatic relevant sorting in the collection:
Sort By: Published Date (Ascending):
Sort By: Published Date (Descending):
These examples clearly show that the dates (which also appear in the work titles) are not sorting in proper order. They don't even change between ascending and descending. The behavior is the same in the catalog search, which offers a publication date sort.
If the feature is actually pulling from a different date field, we'd like to know which one is being referenced, what date format the system will recognize and use to sort properly, and we'd like the Sort By label to be renamed to match the metadata field being referenced.
As a sidenote only tangentially related to this ticket (and perhaps headed for its own ticket someday, or could be rolled into general Hyku upgrades of the future), the Publication Date metadata field seems like a bad choice for the catalog and collection search sort by feature. Not all works even have this metadata field in their work type. For example, Images. The sort by date feature would be better if it pulled a metadata field that appears in all work types, and it would be nice if there was a note in the UI that mentions to users that this is the field for date sorting. With soooooo many date fields across work types, it's very confusing what is used for search facets and sort by features etc. Additionally, the UI could contain a note regarding what date formats the system will actually recognize and use to sort. Is this info already included in Hyku documentation?
See this screenshot of the back end of the UI "add new work" for the kind of note I'm suggesting would include format info and info about sort and facet dependency. Hope this makes sense.
Testing Instructions
Testing note: the staging site was partially reindexed resulting in most existing records being updated but not all. Our assumption is that the cut over will handle the update of all works in production. Most records will pass QA.
Ensure that works & collections have "Created Date" filled in. If there is no Created Date, they will sort to the end of the list, whether sorting by ascending or descending.
Notes
This will require an update of data to remove ["0~"] from blank author (creator) fields.
The text was updated successfully, but these errors were encountered: