Bugzilla – Attachment 110736 Details for
Bug 25265
Elasticsearch - Batch editing items on a biblio can lead to incorrect index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25265: (QA follow-up) Rename biblionumber in ModZebra, index_records
Bug-25265-QA-follow-up-Rename-biblionumber-in-ModZ.patch (text/plain), 3.96 KB, created by
Marcel de Rooy
on 2020-09-25 09:44:16 UTC
(
hide
)
Description:
Bug 25265: (QA follow-up) Rename biblionumber in ModZebra, index_records
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-09-25 09:44:16 UTC
Size:
3.96 KB
patch
obsolete
>From f2401638f33c0fba84cde101874790ce05a00c22 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 25 Sep 2020 07:02:56 +0000 >Subject: [PATCH] Bug 25265: (QA follow-up) Rename biblionumber in ModZebra, > index_records >Content-Type: text/plain; charset=utf-8 > >ModZebra: >The name is very misleading: we can index authid's too here. >And yes, it should not be in C4/Biblio too ;) A first step.. > >Adding the same change here in Koha/SearchEngine/Zebra/Indexer. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Biblio.pm | 18 ++++++++---------- > Koha/SearchEngine/Zebra/Indexer.pm | 12 ++++++------ > 2 files changed, 14 insertions(+), 16 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index e6c973d1db..260535ea7c 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2489,20 +2489,19 @@ sub CountItemsIssued { > > =head2 ModZebra > >- ModZebra( $biblionumber, $op, $server, $record ); >+ ModZebra( $record_number, $op, $server, $record ); > >-$biblionumber is the biblionumber we want to index >+$record_number is the authid or biblionumber we want to index > >-$op is specialUpdate or recordDelete, and is used to know what we want to do >+$op is the operation: specialUpdate or recordDelete > >-$server is the server that we want to update >+$server is authorityserver or biblioserver > > =cut > > sub ModZebra { >-###Accepts a $server variable thus we can use it for biblios authorities or other zebra dbs >- my ( $biblionumber, $op, $server ) = @_; >- $debug && warn "ModZebra: updates requested for: $biblionumber $op $server\n"; >+ my ( $record_number, $op, $server ) = @_; >+ $debug && warn "ModZebra: updates requested for: $record_number $op $server\n"; > my $dbh = C4::Context->dbh; > > # true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates >@@ -2515,17 +2514,16 @@ sub ModZebra { > AND operation = ? > AND done = 0"; > my $check_sth = $dbh->prepare_cached($check_sql); >- $check_sth->execute( $server, $biblionumber, $op ); >+ $check_sth->execute( $server, $record_number, $op ); > my ($count) = $check_sth->fetchrow_array; > $check_sth->finish(); > if ( $count == 0 ) { > my $sth = $dbh->prepare("INSERT INTO zebraqueue (biblio_auth_number,server,operation) VALUES(?,?,?)"); >- $sth->execute( $biblionumber, $server, $op ); >+ $sth->execute( $record_number, $server, $op ); > $sth->finish; > } > } > >- > =head2 EmbedItemsInMarcBiblio > > EmbedItemsInMarcBiblio({ >diff --git a/Koha/SearchEngine/Zebra/Indexer.pm b/Koha/SearchEngine/Zebra/Indexer.pm >index 29213dd8fc..8ead358d9e 100644 >--- a/Koha/SearchEngine/Zebra/Indexer.pm >+++ b/Koha/SearchEngine/Zebra/Indexer.pm >@@ -28,7 +28,7 @@ Koha::SearchEngine::Elasticsearch::Indexer - handles adding new records to the i > =head1 SYNOPSIS > > my $indexer = Koha::SearchEngine::Zebra::Indexer->new(); >- $indexer->index_records( $biblionumbers, $op, $server, $records); >+ $indexer->index_records( $record_numbers, $op, $server, $records); > > > =head1 FUNCTIONS >@@ -45,7 +45,7 @@ sub new { > my $self = $class->SUPER::new(@_); > } > >-=head2 index_records($biblionumbers, $op, $server, $records) >+=head2 index_records($record_numbers, $op, $server, $records) > > This is simply a wrapper to C4::Biblio::ModZebra that takes an array of records and > passes them through individually >@@ -55,10 +55,10 @@ sub new { > =cut > > sub index_records { >- my ( $self, $biblionumbers, $op, $server, $records ) = @_; >- $biblionumbers = [$biblionumbers] if ref $biblionumbers ne 'ARRAY' && defined $biblionumbers; >- foreach my $biblionumber ( @$biblionumbers ){ >- ModZebra( $biblionumber, $op, $server ); >+ my ( $self, $record_numbers, $op, $server, $records ) = @_; >+ $record_numbers = [$record_numbers] if ref $record_numbers ne 'ARRAY' && defined $record_numbers; >+ foreach my $record_number ( @$record_numbers ){ >+ ModZebra( $record_number, $op, $server ); > } > } > >-- >2.11.0
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 25265
:
107832
|
107855
|
107867
|
109538
|
109556
|
110262
|
110263
|
110264
|
110380
|
110381
|
110382
|
110457
|
110458
|
110459
|
110560
|
110561
|
110562
|
110565
|
110594
|
110595
|
110596
|
110597
|
110615
|
110618
|
110729
|
110730
|
110731
|
110732
|
110733
|
110734
| 110736 |
110737
|
110882
|
110883
|
110937