diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 27b33806c9..7241f052c8 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/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; }