@@ -, +, @@ Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. --- Koha/SearchEngine/Elasticsearch.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/Koha/SearchEngine/Elasticsearch.pm +++ a/Koha/SearchEngine/Elasticsearch.pm @@ -556,9 +556,11 @@ sub marc_records_to_documents { if ( $self->index eq 'authorities' ){ my $authtypecode = GuessAuthTypeCode( $record ); if( $authtypecode ){ - my $field = $record->field( $auth_match_headings{ $authtypecode } ); - my $heading = C4::Heading->new_from_field( $field, undef, 1 ); #new auth heading - push @{$record_document->{'match-heading'}}, $heading->search_form if $heading; + if( $authtypecode !~ m/_SUBD/ ){ #Subdivision records will not be used for linking and so don't require match-heading to be built + my $field = $record->field( $auth_match_headings{ $authtypecode } ); + my $heading = C4::Heading->new_from_field( $field, undef, 1 ); #new auth heading + push @{$record_document->{'match-heading'}}, $heading->search_form if $heading; + } } else { warn "Cannot determine authority type for record: " . $record->field('001')->as_string; } --