|
Lines 95-100
my $num_bad_bibs = 0;
Link Here
|
| 95 |
my %unlinked_headings; |
95 |
my %unlinked_headings; |
| 96 |
my %linked_headings; |
96 |
my %linked_headings; |
| 97 |
my %fuzzy_headings; |
97 |
my %fuzzy_headings; |
|
|
98 |
my %nonlinked_headings; |
| 98 |
my $dbh = C4::Context->dbh; |
99 |
my $dbh = C4::Context->dbh; |
| 99 |
my @updated_biblios = (); |
100 |
my @updated_biblios = (); |
| 100 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
101 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
|
Lines 134-142
sub process_bibs {
Link Here
|
| 134 |
|
135 |
|
| 135 |
my $headings_linked = 0; |
136 |
my $headings_linked = 0; |
| 136 |
my $headings_unlinked = 0; |
137 |
my $headings_unlinked = 0; |
|
|
138 |
my $headings_nonlinked = 0; |
| 137 |
my $headings_fuzzy = 0; |
139 |
my $headings_fuzzy = 0; |
| 138 |
for ( values %linked_headings ) { $headings_linked += $_; } |
140 |
for ( values %linked_headings ) { $headings_linked += $_; } |
| 139 |
for ( values %unlinked_headings ) { $headings_unlinked += $_; } |
141 |
for ( values %unlinked_headings ) { $headings_unlinked += $_; } |
|
|
142 |
for ( values %nonlinked_headings ) { $headings_nonlinked += $_; } |
| 140 |
for ( values %fuzzy_headings ) { $headings_fuzzy += $_; } |
143 |
for ( values %fuzzy_headings ) { $headings_fuzzy += $_; } |
| 141 |
|
144 |
|
| 142 |
my $endtime = time(); |
145 |
my $endtime = time(); |
|
Lines 158-163
Number of bibs with errors: $num_bad_bibs
Link Here
|
| 158 |
Number of headings linked: $headings_linked |
161 |
Number of headings linked: $headings_linked |
| 159 |
Number of headings unlinked: $headings_unlinked |
162 |
Number of headings unlinked: $headings_unlinked |
| 160 |
Number of headings fuzzily linked: $headings_fuzzy |
163 |
Number of headings fuzzily linked: $headings_fuzzy |
|
|
164 |
Number of headings not linked: $headings_nonlinked |
| 161 |
_SUMMARY_ |
165 |
_SUMMARY_ |
| 162 |
$summary .= "\n**** Ran in test mode only ****\n" if $test_only; |
166 |
$summary .= "\n**** Ran in test mode only ****\n" if $test_only; |
| 163 |
print $summary; |
167 |
print $summary; |
|
Lines 199-204
_FUZZY_HEADER_
Link Here
|
| 199 |
foreach my $key (@keys) { |
203 |
foreach my $key (@keys) { |
| 200 |
print "$key:\t" . $fuzzy_headings{$key} . " occurrences\n"; |
204 |
print "$key:\t" . $fuzzy_headings{$key} . " occurrences\n"; |
| 201 |
} |
205 |
} |
|
|
206 |
|
| 207 |
print <<_NONLINKED_HEADER_; |
| 208 |
|
| 209 |
Not linked headings (from most frequent to least): |
| 210 |
------------------------------------------------------- |
| 211 |
|
| 212 |
_NONLINKED_HEADER_ |
| 213 |
|
| 214 |
@keys = sort { |
| 215 |
$nonlinked_headings{$b} <=> $nonlinked_headings{$a} |
| 216 |
or "\L$a" cmp "\L$b" |
| 217 |
} keys %nonlinked_headings; |
| 218 |
foreach my $key (@keys) { |
| 219 |
print "$key:\t" . $nonlinked_headings{$key} . " occurrences\n"; |
| 220 |
} |
| 221 |
|
| 202 |
print $summary; |
222 |
print $summary; |
| 203 |
} |
223 |
} |
| 204 |
} |
224 |
} |
|
Lines 236-241
sub process_bib {
Link Here
|
| 236 |
foreach my $key ( keys %{ $results->{'unlinked'} } ) { |
256 |
foreach my $key ( keys %{ $results->{'unlinked'} } ) { |
| 237 |
$unlinked_headings{$key} += $results->{'unlinked'}->{$key}; |
257 |
$unlinked_headings{$key} += $results->{'unlinked'}->{$key}; |
| 238 |
} |
258 |
} |
|
|
259 |
foreach my $key ( keys %{ $results->{'nonlinked'} } ) { |
| 260 |
$nonlinked_headings{$key} += $results->{'nonlinked'}->{$key}; |
| 261 |
} |
| 239 |
foreach my $key ( keys %{ $results->{'linked'} } ) { |
262 |
foreach my $key ( keys %{ $results->{'linked'} } ) { |
| 240 |
$linked_headings{$key} += $results->{'linked'}->{$key}; |
263 |
$linked_headings{$key} += $results->{'linked'}->{$key}; |
| 241 |
} |
264 |
} |
| 242 |
- |
|
|