diff --git a/C4/Heading/UNIMARC.pm b/C4/Heading/UNIMARC.pm index f1b5287708..b998433a43 100644 --- a/C4/Heading/UNIMARC.pm +++ b/C4/Heading/UNIMARC.pm @@ -52,8 +52,8 @@ FIXME - this should be moved to a configuration file. my %subdivisions = ( 'j' => 'formsubdiv', 'x' => 'generalsubdiv', - 'y' => 'chronologicalsubdiv', - 'z' => 'geographicsubdiv', + 'y' => 'geographicsubdiv', + 'z' => 'chronologicalsubdiv', ); my $bib_heading_fields; @@ -160,14 +160,19 @@ sub _get_search_heading { my $code = $subfields[$i]->[0]; my $code_re = quotemeta $code; my $value = $subfields[$i]->[1]; - $value =~ s/[-,.:=;!%\/]*$//; + $value =~ s/[\s]*[-,.:=;!%\/][\s]*$//; next unless $subfields =~ qr/$code_re/; if ($first) { $first = 0; $heading = $value; } else { - $heading .= " $value"; + if ( exists $subdivisions{$code} ) { + $heading .= " $subdivisions{$code} $value"; + } + else { + $heading .= " $value"; + } } } diff --git a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml index 00b4e0be07..91399e3ad7 100644 --- a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml @@ -7,6 +7,12 @@ authority-zebra-indexdefs.xsl` --> marc:controlfield[@tag='001'] + + j + x + y + z + Local-Number:w