Bug 33139

Summary: New facetable boolean Elasticsearch field 'has-eresource'.
Product: Koha Reporter: Andreas Jonsson <andreas.jonsson>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: Patch doesn't apply --- QA Contact:
Severity: new feature    
Priority: P5 - low CC: dcook, lucas
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33140
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 33139 Added "has e-resource" facet for Elasticsearch
Bug 33139 Map boolean field has-eresource to MARC21 856$u
Bug 33139 Map boolean field has-eresource to MARC21 856$u
Bug 33139 Map boolean field has-eresource to MARC21 856$u

Description Andreas Jonsson 2023-03-05 11:40:10 UTC
We would like to have a facetable boolean field in the Elasticsearch
index to quickly filter records that have a link to an electronic
resource in 856$u.  The facets should have labels that makes the purpose
clear.  We can use "Digitally available" and "Only in print" for the negative.
Comment 1 Andreas Jonsson 2023-03-05 11:51:29 UTC
Created attachment 147769 [details] [review]
Bug 33139 Added "has e-resource" facet for Elasticsearch
Comment 2 Andreas Jonsson 2023-03-05 11:51:49 UTC
Created attachment 147770 [details] [review]
Bug 33139 Map boolean field has-eresource to MARC21 856$u
Comment 3 Andreas Jonsson 2023-03-05 12:09:18 UTC
Created attachment 147771 [details] [review]
Bug 33139 Map boolean field has-eresource to MARC21 856$u

Sponsored-by: VTI, Statens väg- och transportforskningsinstitut
Comment 4 Andreas Jonsson 2023-03-05 12:10:07 UTC
Created attachment 147772 [details] [review]
Bug 33139 Map boolean field has-eresource to MARC21 856$u

Sponsored-by: VTI, Statens väg- och transportforskningsinstitut
Comment 5 Katrin Fischer 2023-03-05 14:25:37 UTC
856 can hold a lot of types of e-resources. Some might only be used for scans of TOCs or a front cover scan. I feel like this might be more useful if also the indicator could be taken into account: 

https://www.loc.gov/marc/bibliographic/bd856.html

It looks like second indicator 0 or empty (and maybe 3 and 4) could be useful and would not hurt libraries not setting it.
Comment 6 David Cook 2023-03-05 23:08:48 UTC
(In reply to Katrin Fischer from comment #5)
> 856 can hold a lot of types of e-resources. Some might only be used for
> scans of TOCs or a front cover scan. 

Yeah there can be a lot of links in 856$u that are not really e-resources so I'm not sure about this one...
Comment 7 Andreas Jonsson 2023-03-05 23:28:33 UTC
Currently indicators cannot be specified in the field mappings.

We should specify some syntax for doing this, though.  Maybe:

  has-eresource:
    label: has-eresource
    mandatory: ~
    mappings:
    - facet: 1
      marc_field: 856[14,]u
      marc_type: marc21
      sort: ~
      suggestible: ''
    - facet: 1
      marc_field: 856[7,02]u
      marc_type: marc21
      sort: ~
      suggestible: ''
    opac: 1
    staff_client: 1
    type: boolean

Or:

  has-eresource:
    label: has-eresource
    mandatory: ~
    mappings:
    - facet: 1
      marc_field: 856u
      indicator1: "14"
      marc_type: marc21
      sort: ~
      suggestible: ''
    - facet: 1
      marc_field: 856u
      indicator1: "7"
      indicator2: "02"
      marc_type: marc21
      sort: ~
      suggestible: ''
    opac: 1
    staff_client: 1
    type: boolean

But this should be a separate issue.
Comment 8 Lucas Gass (lukeg) 2023-11-08 20:45:44 UTC
No longer applies cleanly in current master.