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: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, katrin.fischer, mathsabypro
Version: master   
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).