From c14951baee89f00b2de5fe898258683d2322ba40 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 24 Oct 2022 14:03:44 -0300 Subject: [PATCH] Revert "Bug 15187: Index 880 in Zebra the same as Elasticsearch" This reverts commit 85690a14f8685a2eb6cb88316bb4a3145c024cc2. --- Koha/Filter/MARC/Index880InZebra.pm | 88 ----------------------------------- misc/migration_tools/rebuild_zebra.pl | 1 - 2 files changed, 89 deletions(-) delete mode 100644 Koha/Filter/MARC/Index880InZebra.pm diff --git a/Koha/Filter/MARC/Index880InZebra.pm b/Koha/Filter/MARC/Index880InZebra.pm deleted file mode 100644 index 4250e00633..0000000000 --- a/Koha/Filter/MARC/Index880InZebra.pm +++ /dev/null @@ -1,88 +0,0 @@ -package Koha::Filter::MARC::Index880InZebra; - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -=head1 NAME - -Koha::Filter::MARC::Index880InZebra - replace 880 with its linked field number -so that the alternate graphic representation gets indexed appropriately -(see Koha::SearchEngine::Elasticsearch for the ES version) - -=head1 SYNOPSIS - - my $processor = Koha::RecordProcessor->new({ filters => ('Index880InZebra') }); - -=head1 DESCRIPTION - -Filter to rewrite 880 to linked field - -=cut - -use Modern::Perl; - -use C4::Context; - -use base qw(Koha::RecordProcessor::Base); -our $NAME = 'Index880InZebra'; - -our $marcflavour = lc C4::Context->preference('marcflavour'); - -=head2 filter - - my $newrecord = $filter->filter($record); - my $newrecords = $filter->filter(\@records); - -=cut - -sub filter { - my $self = shift; - my $record = shift; - my $newrecord; - - return unless defined $record; - - if (ref $record eq 'ARRAY') { - my @recarray; - foreach my $thisrec (@$record) { - push @recarray, _processrecord($thisrec); - } - $newrecord = \@recarray; - } elsif (ref $record eq 'MARC::Record') { - $newrecord = _processrecord($record); - } - - return $newrecord; -} - -sub _processrecord { - - my $record = shift; - if ($marcflavour && $marcflavour eq 'marc21'){ - my @fields = $record->field('880'); - foreach my $field (@fields){ - my $sub6 = $field->subfield('6'); - if ($sub6 =~ /^(...)-\d+/) { - my $tag = $1; - if ($tag){ - $field->set_tag($tag); - } - } - } - } - return $record; -} - -1; diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index a73e7bdd2f..ec19ce1f5c 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -663,7 +663,6 @@ sub get_corrected_marc_record { push @filters, 'EmbedItemsAvailability'; push @filters, 'EmbedSeeFromHeadings' if C4::Context->preference('IncludeSeeFromInSearches'); - push @filters, 'Index880InZebra'; my $normalizer = Koha::RecordProcessor->new( { filters => \@filters } ); $marc = $normalizer->process($marc); -- 2.11.0