Bugzilla – Attachment 180958 Details for
Bug 39636
Add options to compare_es_to_db script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39636: Add option to specify which indexes to check
Bug-39636-Add-option-to-specify-which-indexes-to-c.patch (text/plain), 2.37 KB, created by
Nick Clemens (kidclamp)
on 2025-04-15 12:02:52 UTC
(
hide
)
Description:
Bug 39636: Add option to specify which indexes to check
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-04-15 12:02:52 UTC
Size:
2.37 KB
patch
obsolete
>From 6d5a418f42436c1e50358938fa77094d1d20bb09 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 15 Apr 2025 11:47:13 +0000 >Subject: [PATCH] Bug 39636: Add option to specify which indexes to check > >This patch adds --biblios and --authorities options to the script to allow >checking only a single index > >To test: >0 - Apply patch >1 - perl misc/maintenance/compare_es_to_db.pl >2 - biblios and authorities are checked >3 - perl misc/maintenance/compare_es_to_db.pl -b >4 - Only biblios are checked >5 - perl misc/maintenance/compare_es_to_db.pl -a >6 - Only authorities are checked >7 - perl misc/maintenance/compare_es_to_db.pl -a -b >8 - Both indexes are checked >--- > misc/maintenance/compare_es_to_db.pl | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > >diff --git a/misc/maintenance/compare_es_to_db.pl b/misc/maintenance/compare_es_to_db.pl >index b5de6d0db3f..f2196768c1b 100755 >--- a/misc/maintenance/compare_es_to_db.pl >+++ b/misc/maintenance/compare_es_to_db.pl >@@ -43,10 +43,16 @@ use Koha::SearchEngine::Elasticsearch; > > my $help; > my $fix; >+my $biblios; >+my $authorities; >+my @indices = (); >+ > > GetOptions( > 'h|help' => \$help, > 'f|fix' => \$fix, >+ 'b|biblios' => \$biblios, >+ 'a|authorities' => \$authorities > ); > > my $usage = <<'ENDUSAGE'; >@@ -54,12 +60,17 @@ my $usage = <<'ENDUSAGE'; > This script finds differences between the records on the Koha database > and the Elasticsearch index. > >-The `--fix` option switch can be passed to try fixing them. >+You can pass `--biblios` or `--authorities` to limit the check to a single index. >+Both will be checked if nothing is specified. >+ >+The `--fix` option switch can be passed to try fixing differences. > > This script has the following parameters : > >- -f|--fix Try to fix errors >- -h|--help Print this message >+ -b|--biblios Check the biblios index >+ -a|authorities Check the authorities index >+ -f|--fix Try to fix errors >+ -h|--help Print this message > > ENDUSAGE > >@@ -68,7 +79,12 @@ if ($help) { > exit; > } > >-foreach my $index ( ( 'biblios', 'authorities' ) ) { >+push @indices, "biblios" if $biblios; >+push @indices, "authorities" if $authorities; >+ >+@indices = ( "biblios", "authorities" ) unless @indices; >+ >+foreach my $index (@indices) { > print "=================\n"; > print "Checking $index\n"; > my @db_records = >-- >2.39.5
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 39636
:
180957
|
180958
|
180959
|
180972
|
180973