Bugzilla – Attachment 150979 Details for
Bug 33277
Correctly handle linking subfields with no defined thesaurus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33277: Add comments and missing thesauri
Bug-33277-Add-comments-and-missing-thesauri.patch (text/plain), 3.13 KB, created by
Marcel de Rooy
on 2023-05-10 12:10:01 UTC
(
hide
)
Description:
Bug 33277: Add comments and missing thesauri
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-10 12:10:01 UTC
Size:
3.13 KB
patch
obsolete
>From 5446b5a97be56572e405052dac487d014fc3a23d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 21 Mar 2023 19:28:10 +0000 >Subject: [PATCH] Bug 33277: Add comments and missing thesauri >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Heading.pm | 2 ++ > C4/Heading/MARC21.pm | 5 +++++ > .../SearchEngine/Elasticsearch/QueryBuilder.pm | 18 ++++++++++++------ > t/db_dependent/Heading.t | 3 +++ > 4 files changed, 22 insertions(+), 6 deletions(-) > >diff --git a/C4/Heading.pm b/C4/Heading.pm >index 3054fc5305..5c393b4d53 100644 >--- a/C4/Heading.pm >+++ b/C4/Heading.pm >@@ -202,6 +202,8 @@ sub _search { > my @operator; > my @value; > >+ # FIXME: We specify values for @and_or and @excluding >+ # but these fields are not used anywhere and should be removed > if ($index) { > push @marclist, $index; > push @and_or, 'AND'; >diff --git a/C4/Heading/MARC21.pm b/C4/Heading/MARC21.pm >index 652c300282..e8d6f90553 100644 >--- a/C4/Heading/MARC21.pm >+++ b/C4/Heading/MARC21.pm >@@ -359,6 +359,11 @@ sub _get_subject_thesaurus { > my $field = shift; > my $ind2 = $field->indicator(2); > >+ # NOTE: sears and aat do not appear >+ # here as they do not have indicator values >+ # though the 008 in the authority records >+ # do have values for them >+ > my $thesaurus = "notdefined"; > if ( $ind2 eq '0' ) { > $thesaurus = "lcsh"; >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index e91c4d7e16..587f86e648 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -564,14 +564,20 @@ our $koha_to_index_name = { > all => '' > }; > >+# Note that sears and aat map to 008/11 values here >+# but don't appear in C4/Headin/MARC21 thesaurus >+# because they don't have values in controlled field indicators >+# https://www.loc.gov/marc/authority/ad008.html > our $thesaurus_to_value = { >- lcsh => 'a', >- lcac => 'b', >- mesh => 'c', >- nal => 'd', >+ lcsh => 'a', >+ lcac => 'b', >+ mesh => 'c', >+ nal => 'd', > notspecified => 'n', >- cash => 'k', >- rvm => 'v', >+ cash => 'k', >+ rvm => 'v', >+ aat => 'r', >+ sears => 's' > }; > > sub build_authorities_query_compat { >diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t >index 92d52e1c38..26c4d8da28 100755 >--- a/t/db_dependent/Heading.t >+++ b/t/db_dependent/Heading.t >@@ -69,6 +69,9 @@ subtest "_search tests" => sub { > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); >+ # NOTE: We are testing solely against ES here to make the assumptions simpler while testing >+ # C4/Headings code specifically. The actual query building and searching code should >+ # be covered in other test files > my $search = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::Search'); > > $search->mock('search_auth_compat', sub { >-- >2.30.2
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 33277
:
148417
|
148418
|
148419
|
148492
|
148493
|
148494
|
148495
|
148500
|
148527
|
148528
|
148529
|
148530
|
148531
|
148734
|
148735
|
148957
|
149837
|
149838
|
149839
|
149840
|
149841
|
149842
|
150890
|
150891
|
150977
|
150978
| 150979 |
150980
|
150981
|
150982
|
150983