View | Details | Raw Unified | Return to bug 32250
Collapse All | Expand All

(-)a/misc/link_bibs_to_authorities.pl (-2 / +15 lines)
Lines 17-22 use Time::HiRes qw( time ); Link Here
17
use POSIX qw( ceil strftime );
17
use POSIX qw( ceil strftime );
18
use Module::Load::Conditional qw( can_load );
18
use Module::Load::Conditional qw( can_load );
19
19
20
use Koha::SearchEngine;
21
use Koha::SearchEngine::Indexer;
22
20
sub usage {
23
sub usage {
21
    pod2usage( -verbose => 2 );
24
    pod2usage( -verbose => 2 );
22
    exit;
25
    exit;
Lines 75-80 my %unlinked_headings; Link Here
75
my %linked_headings;
78
my %linked_headings;
76
my %fuzzy_headings;
79
my %fuzzy_headings;
77
my $dbh = C4::Context->dbh;
80
my $dbh = C4::Context->dbh;
81
my @updated_biblios = ();
82
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
83
78
$dbh->{AutoCommit} = 0;
84
$dbh->{AutoCommit} = 0;
79
process_bibs( $linker, $bib_limit, $auth_limit, $commit, { tagtolink => $tagtolink, allowrelink => $allowrelink });
85
process_bibs( $linker, $bib_limit, $auth_limit, $commit, { tagtolink => $tagtolink, allowrelink => $allowrelink });
80
$dbh->commit();
86
$dbh->commit();
Lines 105-110 sub process_bibs { Link Here
105
    }
111
    }
106
112
107
    if ( not $test_only ) {
113
    if ( not $test_only ) {
114
        $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
108
        $dbh->commit;
115
        $dbh->commit;
109
    }
116
    }
110
117
Lines 226-232 sub process_bib { Link Here
226
            );
233
            );
227
        }
234
        }
228
        if ( not $test_only ) {
235
        if ( not $test_only ) {
229
            ModBiblio( $record, $biblionumber, $frameworkcode, { disable_autolink => 1, skip_holds_queue => 1 });
236
            ModBiblio( $record, $biblionumber, $frameworkcode, {
237
                disable_autolink => 1,
238
                skip_holds_queue => 1,
239
                skip_record_index =>1
240
            });
241
            push @updated_biblios, $biblionumber;
230
            #Last param is to note ModBiblio was called from linking script and bib should not be linked again
242
            #Last param is to note ModBiblio was called from linking script and bib should not be linked again
231
            $num_bibs_modified++;
243
            $num_bibs_modified++;
232
        }
244
        }
Lines 236-241 sub process_bib { Link Here
236
sub print_progress_and_commit {
248
sub print_progress_and_commit {
237
    my $recs = shift;
249
    my $recs = shift;
238
    $dbh->commit();
250
    $dbh->commit();
251
    $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
252
    @updated_biblios = ();
239
    print "... processed $recs records\n";
253
    print "... processed $recs records\n";
240
}
254
}
241
255
242
- 

Return to bug 32250