Bugzilla – Attachment 180972 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.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-04-15 14:32:39 UTC
(
hide
)
Description:
Bug 39636: Add option to specify which indexes to check
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-04-15 14:32:39 UTC
Size:
2.50 KB
patch
obsolete
>From a1df722c473418df97c14eb3519a597ab63fad7b 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 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Edit: tidied >--- > misc/maintenance/compare_es_to_db.pl | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) > >diff --git a/misc/maintenance/compare_es_to_db.pl b/misc/maintenance/compare_es_to_db.pl >index b5de6d0db3f..5a5635ee43c 100755 >--- a/misc/maintenance/compare_es_to_db.pl >+++ b/misc/maintenance/compare_es_to_db.pl >@@ -43,10 +43,15 @@ use Koha::SearchEngine::Elasticsearch; > > my $help; > my $fix; >+my $biblios; >+my $authorities; >+my @indices = (); > > GetOptions( >- 'h|help' => \$help, >- 'f|fix' => \$fix, >+ 'h|help' => \$help, >+ 'f|fix' => \$fix, >+ 'b|biblios' => \$biblios, >+ 'a|authorities' => \$authorities > ); > > my $usage = <<'ENDUSAGE'; >@@ -54,12 +59,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 +78,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.49.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 39636
:
180957
|
180958
|
180959
| 180972 |
180973