Bug 11081: (followup) Add license information
[koha-ffzg.git] / misc / bin / koha-index
1 #!/usr/bin/perl
2 # This file is part of Koha.
3 #
4 # Copyright (C) 2013 Tamil s.a.r.l.
5 #
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
18
19
20 package Main;
21
22 use Modern::Perl;
23 use utf8;
24 use Koha::Indexer::Indexing;
25 use Pod::Usage;
26
27 my $indexer = Koha::Indexer::Indexing->new_with_options();
28 if ( $indexer->help ) {
29     pod2usage( -verbose => 99 );
30     exit;
31 }
32 $indexer->run();
33
34
35 __END__
36
37 =pod
38
39 =head1 SYNOPSIS
40
41  koha-index
42
43  koha-index --verbose
44
45  koha-index --source biblio --select queue
46
47  koha-index --source authority --select all
48
49  koha-index --select queue --directory /tmp/koha-index-mylib --keep
50
51 =head1 DESCRIPTION
52
53 Index queued biblio/autority record, or reindex the whole DB. Koha standard
54 environment variables must ne set appropriately: KOHA_CONF and PERL5LIB.
55
56 =head1 OPTIONS
57
58 =over
59
60 =item --source
61
62 Select records to be indexed: C<biblio> or C<authority>. If not specified,
63 biblio by default.
64
65 =item --select
66
67 Select record to be indexed: C<all> or C<queue>. If not specified, C<all> is
68 selected. If C<all> is selected, zebra database is reset before indexing.
69
70 =item --directory
71
72 Directory where records to be indexed by Zebra are exported. If not specified,
73 a direcory named C<koha-index> is used, and if necessary created, in the
74 current directory. In this directory, sub-directories are created containing
75 records to be updated or deleted by Zebra. If those subdirectories already
76 exist, they are first emptied. The export directory tree is kept after zebra
77 indexing.
78
79 =item --keep
80
81 Keep the directory, and its content, where biblio/authority records have been
82 exported.
83
84 =item --verbose
85
86 Increase the amount of logging. Normally only warnings and errors from the
87 indexing are shown.
88
89 =back
90
91 =head1 SEE ALSO
92
93 =for :list
94 * L<koha-index-daemon>
95
96 =cut