Lines 43-52
use Koha::SearchEngine::Elasticsearch;
Link Here
|
43 |
|
43 |
|
44 |
my $help; |
44 |
my $help; |
45 |
my $fix; |
45 |
my $fix; |
|
|
46 |
my $biblios; |
47 |
my $authorities; |
48 |
my @indices = (); |
49 |
|
46 |
|
50 |
|
47 |
GetOptions( |
51 |
GetOptions( |
48 |
'h|help' => \$help, |
52 |
'h|help' => \$help, |
49 |
'f|fix' => \$fix, |
53 |
'f|fix' => \$fix, |
|
|
54 |
'b|biblios' => \$biblios, |
55 |
'a|authorities' => \$authorities |
50 |
); |
56 |
); |
51 |
|
57 |
|
52 |
my $usage = <<'ENDUSAGE'; |
58 |
my $usage = <<'ENDUSAGE'; |
Lines 54-65
my $usage = <<'ENDUSAGE';
Link Here
|
54 |
This script finds differences between the records on the Koha database |
60 |
This script finds differences between the records on the Koha database |
55 |
and the Elasticsearch index. |
61 |
and the Elasticsearch index. |
56 |
|
62 |
|
57 |
The `--fix` option switch can be passed to try fixing them. |
63 |
You can pass `--biblios` or `--authorities` to limit the check to a single index. |
|
|
64 |
Both will be checked if nothing is specified. |
65 |
|
66 |
The `--fix` option switch can be passed to try fixing differences. |
58 |
|
67 |
|
59 |
This script has the following parameters : |
68 |
This script has the following parameters : |
60 |
|
69 |
|
61 |
-f|--fix Try to fix errors |
70 |
-b|--biblios Check the biblios index |
62 |
-h|--help Print this message |
71 |
-a|authorities Check the authorities index |
|
|
72 |
-f|--fix Try to fix errors |
73 |
-h|--help Print this message |
63 |
|
74 |
|
64 |
ENDUSAGE |
75 |
ENDUSAGE |
65 |
|
76 |
|
Lines 68-74
if ($help) {
Link Here
|
68 |
exit; |
79 |
exit; |
69 |
} |
80 |
} |
70 |
|
81 |
|
71 |
foreach my $index ( ( 'biblios', 'authorities' ) ) { |
82 |
push @indices, "biblios" if $biblios; |
|
|
83 |
push @indices, "authorities" if $authorities; |
84 |
|
85 |
@indices = ( "biblios", "authorities" ) unless @indices; |
86 |
|
87 |
foreach my $index (@indices) { |
72 |
print "=================\n"; |
88 |
print "=================\n"; |
73 |
print "Checking $index\n"; |
89 |
print "Checking $index\n"; |
74 |
my @db_records = |
90 |
my @db_records = |
75 |
- |
|
|