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