Bugzilla – Attachment 182183 Details for
Bug 39503
Linker should always respect thesaurus with LinkerConsiderThesaurus on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39503: Collapse thesaurus if value in 008_/11 = 'z' and 040 $f
Bug-39503-Collapse-thesaurus-if-value-in-00811--z-.patch (text/plain), 3.44 KB, created by
Martin Renvoize (ashimema)
on 2025-05-09 14:25:41 UTC
(
hide
)
Description:
Bug 39503: Collapse thesaurus if value in 008_/11 = 'z' and 040 $f
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-09 14:25:41 UTC
Size:
3.44 KB
patch
obsolete
>From a33ae36c6f5cbcfcd93d2030c3623d07a69c61ed Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Apr 2025 12:36:40 +0000 >Subject: [PATCH] Bug 39503: Collapse thesaurus if value in 008_/11 = 'z' and > 040 $f > >With bug 30280 and subsequent patches we attempt to respect the >thesaurus indication when linking with LinkerConsiderThesaurus on. >However, there are still cases when we link wrong. > >This happens when thesaurus in bibliographic field 6XX is defined by >subfield $2. In such a case the authority record should have 008/11 = 'z' >and, according to https://www.loc.gov/marc/authority/ad008.html >(cf. comment for 008/11 = 'z': "A MARC code for the conventions used to >formulate the heading *may* be contained in subfield $f"), may or may have >thesaurus declared in 040 $f. > >This is why we make a second search attempt in C4::Heading::_search, >but doing so we have to make sure that the resulting authority >record has not a different thesaurus declared in 040 $f. (Note >that 008/11 and 040 $f are indexed with the same search >field: subject-heading-thesaurus. So we search for the >second time in the same search field but with >'notdefined' == 008/11='z' instead of the original >thesaurus taken from subfield $2 of the bibliographic >field 6XX.) This means we have to explicitly check the >content of 040 $f of the resulting authority record. > >Test plan: >========== >1. Turn on the LinkerConsiderThesaurus systempreference. >2. Create an authority record (e.g. TOPIC_TERM) with 008/11 = 'z' and > 040 $f containing a thesaurus indication (e.g. 'kaba'), and a term > in field 150 $a (e.g. Early music). >3. Edit a bibliographic record: in field 650 put 2nd indicator '7', > the term 'Early music' in $a, and a different thesaurus code in $2 > (e.g. 'dbn'). Click the 'Link authorities automatically' button. > Note that 650 'Early music' (dbn) has been linked with and authority > record 'Early music' (kaba). This is wrong. >4. Apply the patch ; restart_all ; reindex ES for authorities with: > koha-elasticsearch --rebuild -d -a kohadev >5. Repeat p. 3. Now the 650 'Early music' (dbn) has not been linked to > an authority record (650 - No matching authority found.) > >Signed-off-by: Janusz Kaczmarek <januszop@gmail.com> >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > Koha/SearchEngine/Elasticsearch.pm | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 1a62a6e4ce2..3111ea306a6 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -937,6 +937,16 @@ sub marc_records_to_documents { > } > } > >+ if ( $self->index eq $AUTHORITIES_INDEX >+ && exists $record_document->{'subject-heading-thesaurus'} >+ && scalar @{ $record_document->{'subject-heading-thesaurus'} } > 1 ) >+ { >+ # We should really only have two thesauri defined in the case where 008/_11 = 'z' and 040$f is defined >+ # In that case, we should drop the z >+ @{ $record_document->{'subject-heading-thesaurus'} } = >+ map { $_ eq 'z' ? () : $_ } @{ $record_document->{'subject-heading-thesaurus'} }; >+ } >+ > # Check if there is at least one available item > if ( $self->index eq $BIBLIOS_INDEX ) { > my ( $tag, $code ) = C4::Biblio::GetMarcFromKohaField('biblio.biblionumber'); >-- >2.49.0
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 39503
:
180082
|
180131
|
180200
|
180201
|
180844
|
180902
|
180903
|
180940
|
180941
|
181205
|
182182
| 182183