Bug 24678

Summary: Add missing search fields to Elasticsearch mappings
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, katrin.fischer, mathsabypro
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27848
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28339
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28378
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28379
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29919
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Joonas Kylmälä 2020-02-18 10:33:04 UTC
The Elasticsearch mappings.yaml file is still missing a lot of search fields compared to Zebra. For example Zebra has 264a and 264c separately indexed but Elasticsearch only has 264 indexed in one search field 'provider'.

You can compare MARC21 search mappings with the files:
- etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
- admin/searchengine/elasticsearch/mappings.yaml
Comment 1 Katrin Fischer 2020-03-16 00:48:40 UTC
I've tried to provide a patch for 264, but ran into a mismatch between Zebra and Elasticsearch:

  pl:
    label: pl
    mappings:
      - facet: ''
        marc_field: '008_/15-17'
        marc_type: marc21
        sort: ~
        suggestible: ''
      - facet: ''
        marc_field: '008_/15-17'
        marc_type: normarc
        sort: ~
        suggestible: ''

The Zebra files are also confusing:

  <index_control_field tag="008" offset="15" length="3">
    <target_index>pl:w</target_index>
  </index_control_field>

  <!-- RDA 264$a      pl:w,pl:p-->
  <index_subfields tag="264" subfields="a">
    <target_index>pl:w</target_index>
    <target_index>pl:p</target_index>
  </index_subfields>

  <!--Index for RDA 264 field-->
  <index_data_field tag="264">
    <target_index>pl:w</target_index>
    <target_index>Provider:w</target_index>
  </index_data_field>

  <!--record.abs line 119: melm 260$a      pl:w,pl:p-->
  <index_subfields tag="260" subfields="a">
    <target_index>pl:w</target_index>
    <target_index>pl:p</target_index>
  </index_subfields>

  <index_data_field tag="260">
    <target_index>pl:w</target_index>
    <target_index>Provider:w</target_index>
  </index_data_field>

At the moment it's kind of a mix up between place of publication (26x$a) and date of publication (008 pos.15... and 26x$c).
Comment 2 Fridolin Somers 2022-10-20 08:08:07 UTC
Still valid ?
Comment 3 Caroline Cyr La Rose 2022-10-20 13:32:12 UTC
Bug 28378 and Bug 28391 add 264 mappings to the default ES mappings.

There isn't one specifically for 264$a. I don't know if it's still needed...
Comment 4 Katrin Fischer 2024-01-06 13:12:03 UTC
All dependent bugs have been closed fixed, closing this one as well.