Bugzilla – Attachment 150980 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: Search thesaurus for 'notspecified'
Bug-33277-Search-thesaurus-for-notspecified.patch (text/plain), 3.18 KB, created by
Marcel de Rooy
on 2023-05-10 12:10:05 UTC
(
hide
)
Description:
Bug 33277: Search thesaurus for 'notspecified'
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-10 12:10:05 UTC
Size:
3.18 KB
patch
obsolete
>From 824d63b7d5c95bf21fcb93f37516511c5b55a464 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 21 Mar 2023 19:34:50 +0000 >Subject: [PATCH] Bug 33277: Search thesaurus for 'notspecified' >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> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 6 ++++-- > .../marc21/authorities/authority-zebra-indexdefs.xsl | 2 +- > t/db_dependent/Heading.t | 12 +++++++++++- > 3 files changed, 16 insertions(+), 4 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 587f86e648..3237bbc5e8 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -573,11 +573,13 @@ our $thesaurus_to_value = { > lcac => 'b', > mesh => 'c', > nal => 'd', >- notspecified => 'n', >+ notapplicable => 'n', > cash => 'k', > rvm => 'v', > aat => 'r', >- sears => 's' >+ sears => 's', >+ notdefined => 'z', >+ notspecified => '|' > }; > > sub build_authorities_query_compat { >diff --git a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >index 0723caf2b4..b38e0f0cd0 100644 >--- a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >@@ -2452,7 +2452,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:choose> > </xslo:when> > <xslo:otherwise> >- <xslo:text>notdefined</xslo:text> >+ <xslo:text>notspecified</xslo:text> > </xslo:otherwise> > </xslo:choose> > </xslo:variable> >diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t >index 26c4d8da28..d65132dbc9 100755 >--- a/t/db_dependent/Heading.t >+++ b/t/db_dependent/Heading.t >@@ -65,7 +65,7 @@ subtest "UNIMARC tests" => sub { > > subtest "_search tests" => sub { > >- plan tests => 7; >+ plan tests => 8; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); >@@ -111,6 +111,16 @@ subtest "_search tests" => sub { > ]; > is_deeply( $terms, $expected_terms, "Search formed as expected with second indicator 7 and subfield 2"); > >+ $field = MARC::Field->new( '650', ' ', '4', a => 'Uncles', x => 'Fiction' ); >+ $heading = C4::Heading->new_from_field($field); >+ ($search_query) = $heading->_search( 'match-heading' ); >+ $terms = $search_query->{query}->{bool}->{must}; >+ $expected_terms = [ >+ { term => { 'match-heading.ci_raw' => 'Uncles generalsubdiv Fiction' } }, >+ { term => { 'subject-heading-thesaurus.ci_raw' => '|' } }, >+ ]; >+ is_deeply( $terms, $expected_terms, "Search looks for thesaurus '|' when second indicator 4"); >+ > $field = MARC::Field->new( '100', ' ', '', a => 'Yankovic, Al', d => '1959-,' ); > $heading = C4::Heading->new_from_field($field); > ($search_query) = $heading->_search( 'match-heading' ); >-- >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