scientist-softserv / palni-palci

Other
1 stars 0 forks source link

Add a Date Created Facet #519

Open crisr15 opened 1 year ago

crisr15 commented 1 year ago

Story

These are the agreed upon details:

updated specs for filter/sort by date: Both functions will use the Date Created field

The filter will appear in the left-hand facet menu, allowing users to filter results between two years. See Atla Digital Library for an example.

In order for dates to allow filtering and sorting, they will need to be formatted as YYYY; YYYY-MM; or YYYY-MM-DD

Acceptance Criteria

Testing Instructions and Sample Files

-

Notes

Implementations

ATLA uses the https://github.com/projectblacklight/blacklight_range_limit gem

DraxIndustries79 commented 1 year ago

Currently, this just is Date Created. PALs needs to figure out formatting, since Date Created isn't all formatted in a usable way.

labradford commented 1 year ago

Related to #521

crisr15 commented 1 year ago

From Amanda in slack: Regarding the dates -- we are leaning towards YYYY-MM-DD format in the date created field, but not strictly requiring that format in case users want to use the field another way (and don't care about conforming for filter/sort). We would like it to be a range like the atla example. -- We are running our plan by our users, so please wait for a thumbs up from us.

crisr15 commented 1 year ago

Amanda from slack: updated specs for filter/sort by date: Both functions will use the Date Created field

summer-cook commented 1 year ago

Not sure if we can use the date range slider with the current field for date_created

Atla uses the blacklight_date_range gem, which requires using a date solr field for the thing it is filtering. Currently, date_created is just a string. In atla, its a Date. see below:

Image

ndroark commented 1 year ago

Date Created facet isn't showing in production repos, including ones that have multiple works with correctly formatted data.

ndroark commented 1 year ago

I have a collection of works with formatted yyyy dates, but they're not sorting correctly, and not appearing in the date range facet, and when I attempt to edit the works I get a 500 error. https://au-archives.hykucommons.org/collections/9cd8a1b8-107c-4b4b-b36d-3c334744b0be?locale=en

ndroark commented 1 year ago

I have a collection of works. Every work has a date created field with a formatted year entry, and a field with a non-formatted text entry. When I search for this collection by title, no date range facet appears, and sort-by-date-created shows works in random order. https://au-archives.hykucommons.org/catalog?based_near_label=&contributor=&creator=&date_created=&depositor=&description=&extent=&keyword=&language=&license=&locale=en&op=AND&publisher=&resource_type=&rights_statement=&search_field=advanced&sort=date_ssi+desc&subject=&title=%22centering+on+ministry%22

summer-cook commented 1 year ago

I have a collection of works with formatted yyyy dates, but they're not sorting correctly, and not appearing in the date range facet, and when I attempt to edit the works I get a 500 error. https://au-archives.hykucommons.org/collections/9cd8a1b8-107c-4b4b-b36d-3c334744b0be?locale=en

for this issue (answer from slack): After a bit more investigation, the error I get when trying to reindex that collection is the same as what was happening to you in the same tenant 2 months ago- thread here It has to do with the based_near field. We are seeing issues because the field contains data, but shouldn’t. Unfortunately when trying to update it, it errors out as well. After speaking with Kiah, i don't believe he found a way to fix the one off collections, but it sounds like theres going to be a ticket to rehab the based_near field in the future

I do think its safe to say this is not related to the date facet/sorting though.

summer-cook commented 1 year ago

I have a collection of works. Every work has a date created field with a formatted year entry, and a field with a non-formatted text entry. When I search for this collection by title, no date range facet appears, and sort-by-date-created shows works in random order. https://au-archives.hykucommons.org/catalog?based_near_label=&contributor=&creator=&date_created=&depositor=&description=&extent=&keyword=&language=&license=&locale=en&op=AND&publisher=&resource_type=&rights_statement=&search_field=advanced&sort=date_ssi+desc&subject=&title=%22centering+on+ministry%22

for this issue (from slack): I am looking at the values in date_created on the works in that search, and since the first value in their date_created fields is not a correctly formatted date, the facet will not show up. The ticket says the following above:

if you can move the season into the description of the work, and make sure the year is the only date in the date created field, it should work as expected. the facet will appear for that search once those updates are made.

ndroark commented 1 year ago

Oh, my understanding was that non-conforming fields would simply be ignored by the sort, so that if you have two date created fields, one conforming and one not, that the conforming field would set and the other be ignored. Is that not right?

If not, do we have an expected behavior for a work with multiple dates that are all conforming?

summer-cook commented 1 year ago

Oh, my understanding was that non-conforming fields would simply be ignored by the sort, so that if you have two date created fields, one conforming and one not, that the conforming field would set and the other be ignored. Is that not right?

this implementation came directly from ATLA - the way it is set up is that the first entered date field is what is used for the sorting & the facet. the way the advanced search gem works is that it can only look at one date per work. everything after the first date is ignored, which is why it is recommended to put any additional information in the description.

If not, do we have an expected behavior for a work with multiple dates that are all conforming?

In these cases, for a work with multiple conforming dates, it is still the first date that will be used for the date facet and for sorting

ndroark commented 1 year ago

Okay, this makes sense. I'll do some more testing with this in mind.

summer-cook commented 1 year ago

Okay, this makes sense. I'll do some more testing with this in mind.

perfect, thanks. let me know if you have any more questions!