Bugzilla – Attachment 117564 Details for
Bug 27784
Unknown authority types break elasticsearch authorities indexing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27784: Don't parse subdivision authorities as headings
Bug-27784-Dont-parse-subdivision-authorities-as-he.patch (text/plain), 2.65 KB, created by
Martin Renvoize (ashimema)
on 2021-03-03 10:41:34 UTC
(
hide
)
Description:
Bug 27784: Don't parse subdivision authorities as headings
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-03 10:41:34 UTC
Size:
2.65 KB
patch
obsolete
>From 3db3a18b463724c6b7efd1124a11b1f1c0f8a4e4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 26 Feb 2021 14:28:42 +0000 >Subject: [PATCH] Bug 27784: Don't parse subdivision authorities as headings > >Subdivision authorities are not used for linking, however, they are recognized by >C4::AuthoritiesMarc > >While these records are not used for linking, they could provide reference and >should be allowed to exist in the catalog without breaking ES indexing > >THis patch simply skips the step of parsing the authorities into the linking form >if the type contains '_SUBD' > >To test: >1 - Import a subdivision authority record via Z39 or use the one attached to this bug >2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d >3 - Authority indexing dies: > 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. >4 - Apply patches >5 - reindex >6 - Success! > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/SearchEngine/Elasticsearch.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >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; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27784
:
117378
|
117379
|
117401
|
117459
|
117460
|
117563
| 117564