Bug 33348: Show authority heading use with Elasticsearch

This patch ensures the ShowHeadingUse system preference and feature works as expected when using Elasticsearch as the searchengine.

To test, follow the test plan at Bug 29990 Comment 9. Ensure the SearchEngine system preference is set to Elasticsearch.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0fc9f22a93)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Aleisha Amohia 2023-03-28 02:10:59 +00:00 committed by Lucas Gass
parent 15e3529648
commit 8e8979cb4e
1 changed files with 12 additions and 0 deletions

View File

@ -248,6 +248,18 @@ sub search_auth_compat {
$result{authtype} = $authtype ? $authtype->authtypetext : $authtypecode;
$result{reported_tag} = $reported_tag;
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';
}
# Reimplementing BuildSummary is out of scope because it'll be hard
$result{summary} =
C4::AuthoritiesMarc::BuildSummary( $marc, $result{authid},