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

(-)a/C4/Installer/PerlDependencies.pm (+40 lines)
Lines 557-562 our $PERL_DEPS = { Link Here
557
        'required' => '1',
557
        'required' => '1',
558
        'min_ver'  => '0.02',
558
        'min_ver'  => '0.02',
559
    },
559
    },
560
    'MooseX::Storage' => {
561
        'usage'    => 'Core',
562
        'required' => '0',
563
        'min_ver'  => '0.30',
564
    },
565
    'MooseX::Types' => {
566
        'usage'    => 'Core',
567
        'required' => '0',
568
        'min_ver'  => '0.30',
569
    },
570
    'MooseX::Getopt' => {
571
        'usage'    => 'Command line scripts',
572
        'required' => '0',
573
        'min_ver'  => '0.46',
574
    },
575
    'MooseX::RW' => {
576
        'usage'    => 'Command line scripts',
577
        'required' => '0',
578
        'min_ver'  => '0.003',
579
    },
580
    'String::RewritePrefix' => {
581
        'usage'    => 'Core',
582
        'required' => '0',
583
        'min_ver'  => '0.006',
584
    },
585
    'Time::Progress' => {
586
        'usage'    => 'Core',
587
        'required' => '0',
588
        'min_ver'  => '1.7',
589
    },
560
    'DBD::Mock' => {
590
    'DBD::Mock' => {
561
        'usage'    => 'Core',
591
        'usage'    => 'Core',
562
        'required' => '1',
592
        'required' => '1',
Lines 617-622 our $PERL_DEPS = { Link Here
617
        'required' => '0',
647
        'required' => '0',
618
        'min_ver'  => '1',
648
        'min_ver'  => '1',
619
    },
649
    },
650
    'AnyEvent::Processor' => {
651
        'usage'    => 'Command line scripts',
652
        'required' => '0',
653
        'min_ver'  => '0.003',
654
    },
655
    'Moose' => {
656
        'usage'    => 'Core',
657
        'required' => '0',
658
        'min_ver'  => '1.09',
659
    },
620
    'String::Random' => {
660
    'String::Random' => {
621
        'usage'    => 'OpacSelfRegistration',
661
        'usage'    => 'OpacSelfRegistration',
622
        'required' => '1',
662
        'required' => '1',
(-)a/Koha/Indexer/Daemon.pm (+116 lines)
Line 0 Link Here
1
package Koha::Indexer::Daemon;
2
3
use Moose;
4
5
use Modern::Perl;
6
use utf8;
7
use AnyEvent;
8
use Koha::Indexer::Indexing;
9
use C4::Context;
10
11
with 'MooseX::Getopt';
12
13
14
has name => ( is => 'rw', isa => 'Str' );
15
16
has directory => ( is => 'rw', isa => 'Str' );
17
18
has timeout => (
19
    is      => 'rw',
20
    isa     => 'Int',
21
    default => 60,
22
);
23
24
has verbose => ( is => 'rw', isa => 'Bool', default => 0 );
25
26
27
sub BUILD {
28
    my $self = shift;
29
30
    say "Starting Koha Indexer Daemon";
31
32
    $self->name( C4::Context->config('database') );
33
34
    my $idle = AnyEvent->timer(
35
        after    => $self->timeout,
36
        interval => $self->timeout,
37
        cb       => sub { $self->index_zebraqueue(); }
38
    );
39
    AnyEvent->condvar->recv;
40
}
41
42
43
sub index_zebraqueue {
44
    my $self = shift;
45
46
    my $dbh = C4::Context->dbh();
47
    my $sql = " SELECT COUNT(*), server
48
                FROM zebraqueue
49
                WHERE done = 0
50
                GROUP BY server ";
51
    my $sth = $dbh->prepare($sql);
52
    $sth->execute();
53
    my %count = ( biblio => 0, authority => 0 );
54
    while ( my ($count, $server) = $sth->fetchrow ) {
55
        $server =~ s/server//g;
56
        $count{$server} = $count;
57
    }
58
59
    say "[", $self->name, "] Index biblio (", $count{biblio}, ") authority (",
60
        $count{authority}, ")";
61
62
    for my $source (qw/biblio authority/) {
63
        next unless $count{$source};
64
        my $indexer = Koha::Indexer::Indexing->new(
65
            source      => $source,
66
            select      => 'queue',
67
            blocking    => 1,
68
            keep        => 1,
69
            verbose     => $self->verbose,
70
        );
71
        $indexer->directory($self->directory) if $self->directory;
72
        $indexer->run();
73
    }
74
}
75
76
no Moose;
77
__PACKAGE__->meta->make_immutable;
78
1;
79
80
__END__
81
=pod
82
83
=head1 SYNOPSIS
84
85
 # Index Koha queued biblio/authority records every minute.
86
 # KOHA_CONF environment variable is used to find which Koha
87
 # instance to use.
88
 # Records are exported from Koha DB into files located in
89
 # the current directory
90
 my $daemon = Koha::Indexer::Daemon->new();
91
92
 my $daemon = Koha::Indexer::Daemon->new(
93
    timeout   => 20,
94
    directory => '/home/koha/mylib/tmp',
95
    verbose   => 1 );
96
97
=head1 Attributes
98
99
=over
100
101
=item directory($directory_name)
102
103
Location of the directory where to export biblio/authority records before
104
sending them to Zebra indexer.
105
106
=item timeout($seconds)
107
108
Number of seconds between indexing.
109
110
=item verbose(0|1)
111
112
Task verbosity.
113
114
=back
115
116
=cut
(-)a/Koha/Indexer/Indexing.pm (+195 lines)
Line 0 Link Here
1
package Koha::Indexer::Indexing;
2
3
use Moose;
4
5
use Modern::Perl;
6
use utf8;
7
use Carp;
8
use Koha::Indexer::RecordReader;
9
use Koha::Indexer::RecordWriter;
10
use AnyEvent::Processor::Conversion;
11
use File::Path;
12
use IO::File;
13
use C4::Context;
14
15
16
with 'MooseX::Getopt';
17
18
19
has source => (
20
    is      => 'rw',
21
    isa     => 'Koha::RecordType',
22
    default => 'biblio'
23
);
24
25
has select => (
26
    is       => 'rw',
27
    isa      => 'Koha::RecordSelect',
28
    required => 1,
29
    default  => 'all',
30
);
31
32
has directory => (
33
    is      => 'rw',
34
    isa     => 'Str',
35
    default => './koha-index',
36
);
37
38
has keep => ( is => 'rw', isa => 'Bool', default => 0 );
39
40
has verbose => ( is => 'rw', isa => 'Bool', default => 0 );
41
42
has help => (
43
    is      => 'rw',
44
    isa     => 'Bool',
45
    default => 0,
46
    traits  => [ 'NoGetopt' ],
47
);
48
49
has blocking => (
50
    is      => 'rw',
51
    isa     => 'Bool',
52
    default => 0,
53
    traits  => [ 'NoGetopt' ],
54
);
55
56
57
sub run {
58
    my $self = shift;
59
60
    # Is it a full indexing of all Koha DB records?
61
    my $is_full_indexing = $self->select =~ /all/i;
62
63
    # Is it biblio indexing (if not it's authority)
64
    my $is_biblio_indexing = $self->source =~ /biblio/i;
65
66
    # STEP 1: All biblio records are exported in a directory
67
68
    unless ( -d $self->directory ) {
69
        mkdir $self->directory
70
            or die "Unable to create directory: " . $self->directory;
71
    }
72
    my $from_dir = $self->directory . "/" . $self->source;
73
    mkdir $from_dir;
74
    for my $dir ( ( "$from_dir/update", "$from_dir/delete") ) {
75
        rmtree( $dir ) if -d $dir;
76
        mkdir $dir;
77
    }
78
79
    # DOM indexing? otherwise GRS-1
80
    my $is_dom = $self->source eq 'biblio'
81
                 ? 'zebra_bib_index_mode'
82
                 : 'zebra_auth_index_mode';
83
    $is_dom = C4::Context->config($is_dom) || '';
84
    $is_dom = $is_dom =~ /dom/i ? 1 : 0;
85
86
    # STEP 1.1: Records to update
87
    say "Exporting records to update" if $self->verbose;
88
    my $exporter = AnyEvent::Processor::Conversion->new(
89
        reader => Koha::Indexer::RecordReader->new(
90
            source => $self->source,
91
            select => $is_full_indexing ? 'all' : 'queue_update',
92
            xml    => '1'
93
        ),
94
        writer => Koha::Indexer::RecordWriter->new(
95
            fh => IO::File->new( "$from_dir/update/records", '>:encoding(utf8)' ),
96
            valid => $is_dom ),
97
        blocking    => $self->blocking,
98
        verbose     => $self->verbose,
99
    );
100
    $exporter->run();
101
102
    # STEP 1.2: Record to delete, if zebraqueue
103
    if ( ! $is_full_indexing ) {
104
        say "Exporting records to delete" if $self->verbose;
105
        $exporter = AnyEvent::Processor::Conversion->new(
106
            reader => Koha::Indexer::RecordReader->new(
107
                source => $self->source,
108
                select => 'queue_delete',
109
                xml    => '1'
110
            ),
111
            writer => Koha::Indexer::RecordWriter->new(
112
                fh => IO::File->new( "$from_dir/delete/records", '>:encoding(utf8)' ),
113
                valid => $is_dom ),
114
            blocking    => $self->blocking,
115
            verbose     => $self->verbose,
116
        );
117
        $exporter->run();
118
    }
119
120
    # STEP 2: Run zebraidx
121
122
    my $cmd;
123
    my $zconfig  = C4::Context->zebraconfig(
124
       $is_biblio_indexing ? 'biblioserver' : 'authorityserver')->{config};
125
    my $db_name  = $is_biblio_indexing ? 'biblios' : 'authorities';
126
    my $cmd_base = "zebraidx -c " . $zconfig;
127
    $cmd_base   .= " -n" if $is_full_indexing; # No shadow: no indexing daemon
128
    $cmd_base   .= $self->verbose ? " -v warning,log" : " -v none";
129
    $cmd_base   .= " -g marcxml";
130
    $cmd_base   .= " -d $db_name";
131
132
    if ( $is_full_indexing ) {
133
        $cmd = "$cmd_base init";
134
        say $cmd if $self->verbose;
135
        system( $cmd );
136
    }
137
138
    $cmd = "$cmd_base update $from_dir/update";
139
    say $cmd if $self->verbose;
140
    system( $cmd );
141
142
    if ( ! $is_full_indexing ) {
143
        $cmd = "$cmd_base adelete $from_dir/delete";
144
        say $cmd if $self->verbose;
145
        system( $cmd );
146
        my $cmd = "$cmd_base commit";
147
        say $cmd if $self->verbose;
148
        system( $cmd );
149
    }
150
151
    rmtree( $self->directory ) unless $self->keep;
152
}
153
154
155
no Moose;
156
__PACKAGE__->meta->make_immutable;
157
158
__END__
159
=pod
160
161
=head1 SYNOPSIS
162
163
 my $indexer = Koha::Indexer->new(
164
   source => 'biblio',
165
   select => 'queue'
166
 );
167
 $indexer->run();
168
169
 my $indexer = Koha::Indexer->new(
170
   source    => 'authority',
171
   select    => 'all',
172
   directory => '/tmp',
173
   verbose   => 1,
174
 );
175
 $indexer->run();
176
177
=head1 DESCRIPTION
178
179
Indexes Koha biblio/authority records, full indexing or queued record indexing.
180
181
182
=head1 Methods
183
184
=over
185
186
=item run
187
188
Runs the indexing task.
189
190
=back
191
192
193
=cut
194
195
1;
(-)a/Koha/Indexer/RecordReader.pm (+263 lines)
Line 0 Link Here
1
package Koha::Indexer::RecordReader;
2
3
use Moose;
4
5
with 'MooseX::RW::Reader';
6
7
8
use Modern::Perl;
9
use utf8;
10
use Moose::Util::TypeConstraints;
11
use MARC::Record;
12
use MARC::File::XML;
13
use C4::Context;
14
use C4::Biblio;
15
use C4::Items;
16
17
18
subtype 'Koha::RecordType'
19
    => as 'Str',
20
    => where { /biblio|authority/i },
21
    => message { "$_ is not a valid Koha::RecordType (biblio or authority" };
22
23
subtype 'Koha::RecordSelect'
24
    => as 'Str',
25
    => where { /all|queue|queue_update|queue_delete/ },
26
    => message {
27
        "$_ is not a valide Koha::RecordSelect " .
28
        "(all or queue or queue_update or queue_delete)"
29
    };
30
31
32
has source => (
33
    is       => 'rw',
34
    isa      => 'Koha::RecordType',
35
    required => 1,
36
    default  => 'biblio',
37
);
38
39
has select => (
40
    is       => 'rw',
41
    isa      => 'Koha::RecordSelect',
42
    required => 1,
43
    default  => 'all',
44
);
45
46
has xml => ( is => 'rw', isa => 'Bool', default => '0' );
47
48
has sth => ( is => 'rw' );
49
50
# Last returned record biblionumber;
51
has id => ( is => 'rw' );
52
53
# Biblio records normalizer, if necessary
54
has normalizer => ( is => 'rw' );
55
56
# Read all records? (or queued records)
57
has allrecords => ( is => 'rw', isa => 'Bool', default => 1 );
58
59
# Mark as done an entry is Zebra queue
60
has sth_queue_done => ( is => 'rw' );
61
62
# Items tag
63
has itemtag => ( is => 'rw' );
64
65
# Las returned record frameworkcode
66
# FIXME: a KohaRecord class should contain this information
67
has frameworkcode => ( is => 'rw', isa => 'Str' );
68
69
70
sub BUILD {
71
    my $self = shift;
72
    my $dbh  = C4::Context->dbh();
73
74
    # Tag containing items
75
    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField("items.itemnumber",'');
76
    $self->itemtag($itemtag);
77
78
    if ( $self->source =~ /biblio/i &&
79
         C4::Context->preference('IncludeSeeFromInSearches') )
80
    {
81
        require Koha::RecordProcessor;
82
        my $normalizer = Koha::RecordProcessor->new( { filters => 'EmbedSeeFromHeadings' } );
83
        $self->normalizer($normalizer);
84
        # Necessary for as_xml method
85
        MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') );
86
    }
87
88
    my $operation = $self->select =~ /update/i
89
                    ? 'specialUpdate'
90
                    : 'recordDelete';
91
    $self->allrecords( $self->select =~ /all/i ? 1 : 0 );
92
    my $sql =
93
        $self->source =~ /biblio/i
94
            ? $self->allrecords
95
                ? "SELECT NULL, biblionumber FROM biblio"
96
                : "SELECT id, biblio_auth_number FROM zebraqueue
97
                   WHERE server = 'biblioserver'
98
                     AND operation = '$operation' AND done = 0"
99
            : $self->allrecords
100
                ? "SELECT NULL, authid FROM auth_header"
101
                : "SELECT id, biblio_auth_number FROM zebraqueue
102
                   WHERE server = 'authorityserver'
103
                     AND operation = '$operation' AND done = 0";
104
    my $sth = $dbh->prepare( $sql );
105
    $sth->execute();
106
    $self->sth( $sth );
107
108
    unless ( $self->allrecords ) {
109
        $self->sth_queue_done( $dbh->prepare(
110
            "UPDATE zebraqueue SET done=1 WHERE id=?" ) );
111
    }
112
113
    __PACKAGE__->meta->add_method( 'get' =>
114
        $self->source =~ /biblio/i
115
            ? $self->xml && !$self->normalizer
116
              ? \&get_biblio_xml
117
              : \&get_biblio_marc
118
            : $self->xml
119
              ? \&get_auth_xml
120
              : \&get_auth_marc
121
    );
122
}
123
124
125
126
sub read {
127
    my $self = shift;
128
    while ( my ($queue_id, $id) = $self->sth->fetchrow ) {
129
        # Suppress entry in zebraqueue table
130
        $self->sth_queue_done->execute($queue_id) if $queue_id;
131
        if ( my $record = $self->get( $id ) ) {
132
            $record = $self->normalizer->process($record) if $self->normalizer;
133
            $self->count($self->count+1);
134
            $self->id( $id );
135
            return $record;
136
        }
137
    }
138
    return 0;
139
}
140
141
142
143
sub get_biblio_xml {
144
    my ( $self, $id ) = @_;
145
    my$dbh = C4::Context->dbh();
146
    my $sth = $dbh->prepare(
147
        "SELECT marcxml FROM biblioitems WHERE biblionumber=? ");
148
    $sth->execute( $id );
149
    my ($marcxml) = $sth->fetchrow;
150
151
    # If biblio isn't found in biblioitems, it is searched in
152
    # deletedbilioitems. Usefull for delete Zebra requests
153
    unless ( $marcxml ) {
154
        $sth = $dbh->prepare(
155
            "SELECT marcxml FROM deletedbiblioitems WHERE biblionumber=? ");
156
        $sth->execute( $id );
157
        ($marcxml) = $sth->fetchrow;
158
    }
159
160
    # Items extraction
161
    # FIXME: It slows down drastically biblio records export
162
    {
163
        my @items = @{ $dbh->selectall_arrayref(
164
            "SELECT * FROM items WHERE biblionumber=$id",
165
            {Slice => {} } ) };
166
        if (@items){
167
            my $record = MARC::Record->new;
168
            $record->encoding('UTF-8');
169
            my @itemsrecord;
170
            foreach my $item (@items) {
171
                my $record = Item2Marc($item, $id);
172
                push @itemsrecord, $record->field($self->itemtag);
173
            }
174
            $record->insert_fields_ordered(@itemsrecord);
175
            my $itemsxml = $record->as_xml_record();
176
            $marcxml =
177
                substr($marcxml, 0, length($marcxml)-10) .
178
                substr($itemsxml, index($itemsxml, "</leader>\n", 0) + 10);
179
        }
180
    }
181
    return $marcxml;
182
}
183
184
185
# Get biblio record, if the record doesn't exist in biblioitems, it is searched
186
# in deletedbiblioitems.
187
sub get_biblio_marc {
188
    my ( $self, $id ) = @_;
189
190
    my $dbh = C4::Context->dbh();
191
    my $sth = $dbh->prepare(
192
        "SELECT marcxml FROM biblioitems WHERE biblionumber=? ");
193
    $sth->execute( $id );
194
    my ($marcxml) = $sth->fetchrow;
195
196
    unless ( $marcxml ) {
197
        $sth = $dbh->prepare(
198
            "SELECT marcxml FROM deletedbiblioitems WHERE biblionumber=? ");
199
        $sth->execute( $id );
200
        ($marcxml) = $sth->fetchrow;
201
    }
202
203
    $marcxml =~ s/[^\x09\x0A\x0D\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]//g;
204
    my $record = MARC::Record->new();
205
    if ($marcxml) {
206
        $record = eval {
207
            MARC::Record::new_from_xml( $marcxml, "utf8" ) };
208
        if ($@) { warn " problem with: $id : $@ \n$marcxml"; }
209
210
        # Items extraction if Koha v3.4 and above
211
        # FIXME: It slows down drastically biblio records export
212
        if ( $self->itemsextraction ) {
213
            my @items = @{ $dbh->selectall_arrayref(
214
                "SELECT * FROM items WHERE biblionumber=$id",
215
                {Slice => {} } ) };
216
            if (@items){
217
                my @itemsrecord;
218
                foreach my $item (@items) {
219
                    my $record = Item2Marc($item, $id);
220
                    push @itemsrecord, $record->field($self->itemtag);
221
                }
222
                $record->insert_fields_ordered(@itemsrecord);
223
            }
224
        }
225
        return $record;
226
    }
227
    return;
228
}
229
230
231
sub get_auth_xml {
232
    my ( $self, $id ) = @_;
233
234
    my $dbh = C4::Context->dbh();
235
    my $sth = $dbh->prepare(
236
        "select marcxml from auth_header where authid=? "  );
237
    $sth->execute( $id );
238
    my ($xml) = $sth->fetchrow;
239
240
    # If authority isn't found we build a mimimalist record
241
    # Usefull for delete Zebra requests
242
    unless ( $xml ) {
243
        return
244
            "<record
245
               xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
246
               xsi:schemaLocation=\"http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd\"
247
               xmlns=\"http://www.loc.gov/MARC21/slim\">
248
             <leader>                        </leader>
249
             <controlfield tag=\"001\">$id</controlfield>
250
             </record>\n";
251
    }
252
253
    my $new_xml = '';
254
    foreach ( split /\n/, $xml ) {
255
        next if /^<collection|^<\/collection/;
256
        $new_xml .= "$_\n";
257
    }
258
    return $new_xml;
259
}
260
261
262
no Moose;
263
1;
(-)a/Koha/Indexer/RecordWriter.pm (+59 lines)
Line 0 Link Here
1
package Koha::Indexer::RecordWriter;
2
use Moose;
3
4
with 'MooseX::RW::Writer::File';
5
6
7
use Carp;
8
use MARC::Batch;
9
use MARC::Record;
10
use MARC::File::XML;
11
12
13
# Is XML Stream a valid marcxml
14
# By default no => no <collection> </collection>
15
has valid => (
16
    is => 'rw',
17
    isa => 'Bool',
18
    default => 0,
19
);
20
21
22
sub begin {
23
    my $self = shift;
24
    if ( $self->valid ) {
25
        my $fh = $self->fh;
26
        print $fh '<?xml version="1.0" encoding="UTF-8"?>', "\n", '<collection>', "\n";
27
    }
28
}
29
30
31
sub end {
32
    my $self = shift;
33
    my $fh = $self->fh;
34
    if ( $self->valid ) {
35
        print $fh '</collection>', "\n";
36
    }
37
    $fh->flush();
38
}
39
40
41
42
#
43
# Sent record is rather a MARC::Record object or an marcxml string
44
#
45
sub write {
46
    my ($self, $record) = @_;
47
48
    $self->count( $self->count + 1 );
49
50
    my $fh  = $self->fh;
51
    my $xml = ref($record) eq 'MARC::Record'
52
              ? $record->as_xml_record() : $record;
53
    $xml =~ s/<\?xml version="1.0" encoding="UTF-8"\?>\n//g if $self->valid;
54
    print $fh $xml;
55
}
56
57
__PACKAGE__->meta->make_immutable;
58
59
1;
(-)a/misc/bin/koha-index (+79 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
package Main;
4
5
use Modern::Perl;
6
use utf8;
7
use Koha::Indexer::Indexing;
8
use Pod::Usage;
9
10
my $indexer = Koha::Indexer::Indexing->new_with_options();
11
if ( $indexer->help ) {
12
    pod2usage( -verbose => 99 );
13
    exit;
14
}
15
$indexer->run();
16
17
18
__END__
19
20
=pod
21
22
=head1 SYNOPSIS
23
24
 koha-index
25
26
 koha-index --verbose
27
28
 koha-index --source biblio --select queue
29
30
 koha-index --source authority --select all
31
32
 koha-index --select queue --directory /tmp/koha-index-mylib --keep
33
34
=head1 DESCRIPTION
35
36
Index queued biblio/autority record, or reindex the whole DB. Koha standard
37
environment variables must ne set appropriately: KOHA_CONF and PERL5LIB.
38
39
=head1 OPTIONS
40
41
=over
42
43
=item --source
44
45
Select records to be indexed: C<biblio> or C<authority>. If not specified,
46
biblio by default.
47
48
=item --select
49
50
Select record to be indexed: C<all> or C<queue>. If not specified, C<all> is
51
selected. If C<all> is selected, zebra database is reset before indexing.
52
53
=item --directory
54
55
Directory where records to be indexed by Zebra are exported. If not specified,
56
a direcory named C<koha-index> is used, and if necessary created, in the
57
current directory. In this directory, sub-directories are created containing
58
records to be updated or deleted by Zebra. If those subdirectories already
59
exist, they are first emptied. The export directory tree is kept after zebra
60
indexing.
61
62
=item --keep
63
64
Keep the directory, and its content, where biblio/authority records have been
65
exported.
66
67
=item --verbose
68
69
Increase the amount of logging. Normally only warnings and errors from the
70
indexing are shown.
71
72
=back
73
74
=head1 SEE ALSO
75
76
=for :list
77
* L<koha-index-daemon>
78
79
=cut
(-)a/misc/bin/koha-index-daemon (-1 / +49 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
package Main;
4
5
use Modern::Perl;
6
use utf8;
7
use Koha::Indexer::Daemon;
8
use Pod::Usage;
9
10
Koha::Indexer::Daemon->new_with_options();
11
12
__END__
13
14
=pod
15
16
=head1 SYNOPSIS
17
18
 koha-index-daemon
19
20
 koha-index-daemon --timeout 60
21
22
 koha-index-daemon --timeout 60 --directory /home/mylib/tmp
23
24
=head1 DESCRIPTION
25
26
Examine periodicaly zebraqueue table from a Koha instance and index
27
bilbio/authority records.
28
29
=head1 OPTIONS
30
31
=over
32
33
=item --timeout
34
35
Specify the daemon timeout in seconds.
36
37
=item --directory
38
39
Directory where to write record exported from Koha DB before sending them to
40
Zebra. Subdirectories are created.
41
42
=back
43
44
=head1 SEE ALSO
45
46
=for :list
47
* L<koha-index>
48
49
=cut

Return to bug 11081