emory-libraries / blacklight-catalog

1 stars 2 forks source link

Ensure that Physical/Online access is accurate in the Access facet #494

Closed eporter23 closed 3 years ago

eporter23 commented 3 years ago

Story: As an end user, I want to see accurate information in facets and search results about whether or not an item is available on-site or online, so that I don't spend time viewing item details on resources that don't offer the mode of access I need

Below are just a few examples that show both modes of access, but when you look at the real time availability data, there is only 1 mode in the availability information (either AVA or AVE):

9936730193902486
990027986580302486 9937273847202486

Also, doing a facet search on Online and At the Library, when you click through the results you can see right away that many of the items incorrectly show two modes of access in the results list, but when you click through to view the details, they only have one.

https://blackcat-test.library.emory.edu/?f%5Bmarc_resource_ssim%5D%5B%5D=Online&f%5Bmarc_resource_ssim%5D%5B%5D=At+the+Library&per_page=10

bwatson78 commented 3 years ago

@Lisa and @eporter23 Please let me know if my train of thought is kosher:

  1. For 9936730193902486, it's falsely stating as a physical because we're looking just for the presence of field 997. This record currently has ©2018 Cassidy Cataloguing Services, Inc. in the subfield "a". A possible refinement for this to be correct would be to test if the record has a present subfield "c" in the "997" datafield, or in pseudocode: if record.fields('997').any? { |field| field.subfields('c').present? }
  2. (Bear in mind that I'm writing this as I analyze each record) Record 990027986580302486 proves my pseudocode above faulty, since it would deny that it was a book, even though clearly it is. The difference in the "997" datafield is that this record has a subfield "b" with the value of book, and neither record has a subfield "c" present, so I'd propose a change to: if record.fields('997').any? { |field| field.subfields('b') == "BOOK" } and to appropriately check for whether it's an online item: if record.fields('998').any? { |field| field.subfields('c') == "Available" }
  3. 9937273847202486 would appropriately process if the above logic was in place. Knowing this, I'm going to examine records on my local that register as both and see if that logic works for all of them.

While I do that, feel free to "at" me and tell me if I have flaws in this logic.

bwatson78 commented 3 years ago

I would have to change this line: if record.fields('997').any? { |field| field.subfields('b') == "BOOK" } to if record.fields('997').any? { |field| field.subfields('b').present? } because of items like 990018920550302486.

bwatson78 commented 3 years ago

I have enough evidence for this to move forward with code changes.

bwatson78 commented 3 years ago

Making one more change after testing for changes:

if record.fields('998').any? { |field| field.subfields('c') == "Available" } OR record.fields('856').present?

@lisahamlett and @eporter23 Please let me know if I'm barking up the wrong tree.

lisahamlett commented 3 years ago

@bwatson78 Sounds good to me.

bwatson78 commented 3 years ago

PR made: https://github.com/emory-libraries/blacklight-catalog/pull/504

No screenshots necessary.

lovinscari commented 3 years ago

@eporter23 - Can you please review and comment or comment and close? Thanks!

eporter23 commented 3 years ago

@lovinscari I'm okay to either wait until we reindex test or we can close this and review it later. My spot checking in arch looks good. We can also look at options regarding the Table of Contents links that appearing. Unfortunately most of these seem to be cataloging issues, so we either need to look at data cleanup or doing a workaround to filter them out.

lovinscari commented 3 years ago

I will add the issue around the 856 field and TOC to the Known Issues in our Requirements Matrix.