Bugzilla – Attachment 162062 Details for
Bug 36069
(bug 29990 follow-up) authority heading use in search results should work with ES as well
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36069: (bug 29990 follow-up) authority heading use in search results should work with ES as well
Bug-36069-bug-29990-follow-up-authority-heading-us.patch (text/plain), 2.20 KB, created by
Janusz Kaczmarek
on 2024-02-12 16:37:47 UTC
(
hide
)
Description:
Bug 36069: (bug 29990 follow-up) authority heading use in search results should work with ES as well
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-02-12 16:37:47 UTC
Size:
2.20 KB
patch
obsolete
>From a265ddadf772a6fbb275e5b8ca2cc1f2ee255453 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Mon, 12 Feb 2024 16:27:00 +0000 >Subject: [PATCH] Bug 36069: (bug 29990 follow-up) authority heading use in > search results should work with ES as well > >It seems that the enhancement introduced with bug 29990 (syspref: ShowHeadingUse) works >only with Zebra (generation of main/subject/series use info is made only in >C4::AuthoritiesMarc == a Zebra incarnation of search_auth_compat) and has no effect >on ES search results. > >This patch does the same for ES. > >Test plan: > >1. Have an installation with Elasticsearch enabled. >2. Go to Koha Administration -> system preferences -> searching tab. > Enable ShowHeadingUse system preference. >3. Do an authority search. Notice that in the Heading use column you get always > 'x' for all use types: main/subject/series. >4. Apply the patch. >5. Do an authority search. Notice that you get now 'v' or 'x' for use types > main/subject/series, depending on the 008/14-16 bytes. >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 933b52f79d..2f164b6397 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -250,6 +250,17 @@ sub search_auth_compat { > $result{summary} = > C4::AuthoritiesMarc::BuildSummary( $marc, $result{authid}, > $authtypecode ); >+ if ( C4::Context->preference('ShowHeadingUse') ) { >+ # checking valid heading use >+ my $f008 = $marc->field('008'); >+ my $pos14to16 = substr( $f008->data, 14, 3 ); >+ my $main = substr( $pos14to16, 0, 1 ); >+ $result{main} = 1 if $main eq 'a'; >+ my $subject = substr( $pos14to16, 1, 1); >+ $result{subject} = 1 if $subject eq 'a'; >+ my $series = substr( $pos14to16, 2, 1 ); >+ $result{series} = 1 if $series eq 'a'; >+ } > $result{used} = $self->count_auth_use($bib_searcher, $authid); > } > push @records, \%result; >-- >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 36069
:
162062
|
162089