Bugzilla – Attachment 131767 Details for
Bug 30280
Support authority records with common subject headings from different thesaurus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Handle subject headings from differens thesaurus
Handle-subject-headings-from-differens-thesaurus.patch (text/plain), 4.82 KB, created by
Frank Hansen
on 2022-03-16 08:32:39 UTC
(
hide
)
Description:
Handle subject headings from differens thesaurus
Filename:
MIME Type:
Creator:
Frank Hansen
Created:
2022-03-16 08:32:39 UTC
Size:
4.82 KB
patch
obsolete
>From 0a2d488921ff2a086dc2f0c68860d6fba731b06f Mon Sep 17 00:00:00 2001 >From: Frank Hansen <frank.hansen@ub.lu.se> >Date: Tue, 15 Mar 2022 15:50:18 +0000 >Subject: [PATCH] Handle subject headings from differens thesaurus > >https://bugs.koha-community.org/show_bug.cgi?id=30280 >--- > C4/Heading.pm | 41 +++++++++++++++---- > C4/Linker/Default.pm | 17 ++++---- > .../Elasticsearch/QueryBuilder.pm | 1 + > 3 files changed, 44 insertions(+), 15 deletions(-) > >diff --git a/C4/Heading.pm b/C4/Heading.pm >index 4d67cd5624..3384c3a7f0 100644 >--- a/C4/Heading.pm >+++ b/C4/Heading.pm >@@ -194,6 +194,8 @@ sub _search { > my $self = shift; > my $index = shift || undef; > my $skipmetadata = shift || undef; >+ my $ind2 = $self->{field}->{_ind2}; >+ my $subject_heading_thesaurus = ''; > my @marclist; > my @and_or; > my @excluding = []; >@@ -207,13 +209,38 @@ sub _search { > push @value, $self->{'search_form'}; > } > >- # if ($self->{'thesaurus'}) { >- # push @marclist, 'thesaurus'; >- # push @and_or, 'AND'; >- # push @excluding, ''; >- # push @operator, 'is'; >- # push @value, $self->{'thesaurus'}; >- # } >+ if ($self->{'thesaurus'}) { >+ if ($ind2 eq '0') { >+ $subject_heading_thesaurus = 'a'; >+ } elsif ($ind2 eq '1') { >+ $subject_heading_thesaurus = 'b'; >+ } elsif ($ind2 eq '2') { >+ $subject_heading_thesaurus = 'c'; >+ } elsif ($ind2 eq '3') { >+ $subject_heading_thesaurus = 'd'; >+ } elsif ($ind2 eq '4') { >+ $subject_heading_thesaurus = 'n'; >+ } elsif ($ind2 eq '5') { >+ $subject_heading_thesaurus = 'k'; >+ } elsif ($ind2 eq '6') { >+ $subject_heading_thesaurus = 'v'; >+ } else { >+ $subject_heading_thesaurus = 'z'; >+ } >+ push @marclist, 'thesaurus'; >+ push @and_or, 'and'; >+ push @excluding, ''; >+ push @operator, 'is'; >+ push @value, $subject_heading_thesaurus; >+ } >+ >+ if ($ind2 eq '7') { >+ push @marclist, 'thesaurus-conventions'; >+ push @and_or, 'and'; >+ push @excluding, ''; >+ push @operator, 'is'; >+ push @value, $self->{'thesaurus'}; >+ } > > require Koha::SearchEngine::QueryBuilder; > require Koha::SearchEngine::Search; >diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm >index 88d75ff1be..0ab5763489 100644 >--- a/C4/Linker/Default.pm >+++ b/C4/Linker/Default.pm >@@ -30,14 +30,15 @@ sub get_link { > my $behavior = shift || 'default'; > my $search_form = $heading->search_form(); > my $auth_type = $heading->auth_type(); >+ my $thesaurus = $heading->{thesaurus}; > my $authid; > my $fuzzy = 0; > my $match_count; > >- if ( $self->{'cache'}->{$search_form.$auth_type}->{'cached'} ) { >- $authid = $self->{'cache'}->{$search_form.$auth_type}->{'authid'}; >- $fuzzy = $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'}; >- $match_count = $self->{'cache'}->{$search_form.$auth_type}->{'match_count'}; >+ if ( $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'cached'} ) { >+ $authid = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'authid'}; >+ $fuzzy = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'fuzzy'}; >+ $match_count = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'match_count'}; > } > else { > >@@ -75,10 +76,10 @@ sub get_link { > } > } > >- $self->{'cache'}->{$search_form.$auth_type}->{'cached'} = 1; >- $self->{'cache'}->{$search_form.$auth_type}->{'authid'} = $authid; >- $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'} = $fuzzy; >- $self->{'cache'}->{$search_form.$auth_type}->{'match_count'} = $match_count; >+ $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'cached'} = 1; >+ $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'authid'} = $authid; >+ $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'fuzzy'} = $fuzzy; >+ $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'match_count'} = $match_count; > } > return $self->SUPER::_handle_auth_limit($authid), $fuzzy, $match_count; > } >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 3e2cb1b784..1041ff10bd 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -553,6 +553,7 @@ our $koha_to_index_name = { > 'match-heading' => 'match-heading', > 'see-from' => 'match-heading-see-from', > thesaurus => 'subject-heading-thesaurus', >+ 'thesaurus-conventions' => 'subject-heading-thesaurus-conventions', > any => '', > all => '' > }; >-- >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 30280
:
131753
|
131754
|
131755
|
131756
|
131766
|
131767
|
131768
|
131769
|
131770
|
131771
|
131772
|
131773
|
131774
|
137440
|
137818
|
137819
|
137820
|
137890
|
137891
|
137892
|
137897
|
137898
|
137899
|
137900
|
137901
|
137902
|
139854
|
139855
|
139856
|
140040
|
140041
|
140042
|
140044
|
140045
|
140046
|
140284
|
140285
|
140286
|
140287