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

(-)a/C4/Biblio.pm (-10 / +8 lines)
Lines 2489-2508 sub CountItemsIssued { Link Here
2489
2489
2490
=head2 ModZebra
2490
=head2 ModZebra
2491
2491
2492
  ModZebra( $biblionumber, $op, $server, $record );
2492
  ModZebra( $record_number, $op, $server, $record );
2493
2493
2494
$biblionumber is the biblionumber we want to index
2494
$record_number is the authid or biblionumber we want to index
2495
2495
2496
$op is specialUpdate or recordDelete, and is used to know what we want to do
2496
$op is the operation: specialUpdate or recordDelete
2497
2497
2498
$server is the server that we want to update
2498
$server is authorityserver or biblioserver
2499
2499
2500
=cut
2500
=cut
2501
2501
2502
sub ModZebra {
2502
sub ModZebra {
2503
###Accepts a $server variable thus we can use it for biblios authorities or other zebra dbs
2503
    my ( $record_number, $op, $server ) = @_;
2504
    my ( $biblionumber, $op, $server ) = @_;
2504
    $debug && warn "ModZebra: updates requested for: $record_number $op $server\n";
2505
    $debug && warn "ModZebra: updates requested for: $biblionumber $op $server\n";
2506
    my $dbh = C4::Context->dbh;
2505
    my $dbh = C4::Context->dbh;
2507
2506
2508
    # true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates
2507
    # true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates
Lines 2515-2531 sub ModZebra { Link Here
2515
        AND   operation = ?
2514
        AND   operation = ?
2516
        AND   done = 0";
2515
        AND   done = 0";
2517
    my $check_sth = $dbh->prepare_cached($check_sql);
2516
    my $check_sth = $dbh->prepare_cached($check_sql);
2518
    $check_sth->execute( $server, $biblionumber, $op );
2517
    $check_sth->execute( $server, $record_number, $op );
2519
    my ($count) = $check_sth->fetchrow_array;
2518
    my ($count) = $check_sth->fetchrow_array;
2520
    $check_sth->finish();
2519
    $check_sth->finish();
2521
    if ( $count == 0 ) {
2520
    if ( $count == 0 ) {
2522
        my $sth = $dbh->prepare("INSERT INTO zebraqueue  (biblio_auth_number,server,operation) VALUES(?,?,?)");
2521
        my $sth = $dbh->prepare("INSERT INTO zebraqueue  (biblio_auth_number,server,operation) VALUES(?,?,?)");
2523
        $sth->execute( $biblionumber, $server, $op );
2522
        $sth->execute( $record_number, $server, $op );
2524
        $sth->finish;
2523
        $sth->finish;
2525
    }
2524
    }
2526
}
2525
}
2527
2526
2528
2529
=head2 EmbedItemsInMarcBiblio
2527
=head2 EmbedItemsInMarcBiblio
2530
2528
2531
    EmbedItemsInMarcBiblio({
2529
    EmbedItemsInMarcBiblio({
(-)a/Koha/SearchEngine/Zebra/Indexer.pm (-7 / +6 lines)
Lines 28-34 Koha::SearchEngine::Elasticsearch::Indexer - handles adding new records to the i Link Here
28
=head1 SYNOPSIS
28
=head1 SYNOPSIS
29
29
30
    my $indexer = Koha::SearchEngine::Zebra::Indexer->new();
30
    my $indexer = Koha::SearchEngine::Zebra::Indexer->new();
31
    $indexer->index_records( $biblionumbers, $op, $server, $records);
31
    $indexer->index_records( $record_numbers, $op, $server, $records);
32
32
33
33
34
=head1 FUNCTIONS
34
=head1 FUNCTIONS
Lines 45-51 sub new { Link Here
45
    my $self = $class->SUPER::new(@_);
45
    my $self = $class->SUPER::new(@_);
46
}
46
}
47
47
48
=head2 index_records($biblionumbers, $op, $server, $records)
48
=head2 index_records($record_numbers, $op, $server, $records)
49
49
50
    This is simply a wrapper to C4::Biblio::ModZebra that takes an array of records and
50
    This is simply a wrapper to C4::Biblio::ModZebra that takes an array of records and
51
    passes them through individually
51
    passes them through individually
Lines 55-64 sub new { Link Here
55
=cut
55
=cut
56
56
57
sub index_records {
57
sub index_records {
58
    my ( $self, $biblionumbers, $op, $server, $records ) = @_;
58
    my ( $self, $record_numbers, $op, $server, $records ) = @_;
59
    $biblionumbers = [$biblionumbers] if ref $biblionumbers ne 'ARRAY' && defined $biblionumbers;
59
    $record_numbers = [$record_numbers] if ref $record_numbers ne 'ARRAY' && defined $record_numbers;
60
    foreach my $biblionumber ( @$biblionumbers ){
60
    foreach my $record_number ( @$record_numbers ){
61
        ModZebra( $biblionumber, $op, $server );
61
        ModZebra( $record_number, $op, $server );
62
    }
62
    }
63
}
63
}
64
64
65
- 

Return to bug 25265