|
Lines 64-69
Only index the supplied biblionumber, mostly for testing purposes. May be
Link Here
|
| 64 |
repeated. This also applies to authorities via authid, so if you're using it, |
64 |
repeated. This also applies to authorities via authid, so if you're using it, |
| 65 |
you probably only want to do one or the other at a time. |
65 |
you probably only want to do one or the other at a time. |
| 66 |
|
66 |
|
|
|
67 |
=item B<--offset> |
| 68 |
|
| 69 |
Specify the row number for the first row to be indexed. |
| 70 |
|
| 71 |
=item B<--length> |
| 72 |
|
| 73 |
Specify the number of rows to be indexed. |
| 74 |
|
| 75 |
|
| 67 |
=item B<-v|--verbose> |
76 |
=item B<-v|--verbose> |
| 68 |
|
77 |
|
| 69 |
By default, this program only emits warnings and errors. This makes it talk |
78 |
By default, this program only emits warnings and errors. This makes it talk |
|
Lines 98-113
my $commit = 5000;
Link Here
|
| 98 |
my ($delete, $help, $man); |
107 |
my ($delete, $help, $man); |
| 99 |
my ($index_biblios, $index_authorities); |
108 |
my ($index_biblios, $index_authorities); |
| 100 |
my (@biblionumbers); |
109 |
my (@biblionumbers); |
|
|
110 |
my ($offset, $length); |
| 101 |
|
111 |
|
| 102 |
$|=1; # flushes output |
112 |
$|=1; # flushes output |
| 103 |
|
113 |
|
| 104 |
GetOptions( |
114 |
GetOptions( |
| 105 |
'c|commit=i' => \$commit, |
115 |
'c|commit=i' => \$commit, |
| 106 |
'd|delete' => \$delete, |
116 |
'd|delete' => \$delete, |
| 107 |
'a|authorities' => \$index_authorities, |
117 |
'a|authorities' => \$index_authorities, |
| 108 |
'b|biblios' => \$index_biblios, |
118 |
'b|biblios' => \$index_biblios, |
| 109 |
'bn|bnumber=i' => \@biblionumbers, |
119 |
'bn|bnumber=i' => \@biblionumbers, |
| 110 |
'v|verbose+' => \$verbose, |
120 |
'v|verbose+' => \$verbose, |
|
|
121 |
'offset=i' => \$offset, |
| 122 |
'length=i' => \$length, |
| 111 |
'h|help' => \$help, |
123 |
'h|help' => \$help, |
| 112 |
'man' => \$man, |
124 |
'man' => \$man, |
| 113 |
); |
125 |
); |
|
Lines 131-138
if ($index_biblios) {
Link Here
|
| 131 |
return () unless defined $r; |
143 |
return () unless defined $r; |
| 132 |
return ($r, Koha::BiblioUtils->get_from_biblionumber($r, item_data => 1 )); |
144 |
return ($r, Koha::BiblioUtils->get_from_biblionumber($r, item_data => 1 )); |
| 133 |
}; |
145 |
}; |
| 134 |
} else { |
146 |
} else { |
| 135 |
my $records = Koha::BiblioUtils->get_all_biblios_iterator(); |
147 |
my $records = Koha::BiblioUtils->get_all_biblios_iterator($offset, $length); |
| 136 |
$next = sub { |
148 |
$next = sub { |
| 137 |
$records->next(); |
149 |
$records->next(); |
| 138 |
} |
150 |
} |
|
Lines 149-155
if ($index_authorities) {
Link Here
|
| 149 |
return ($r, $a->record); |
161 |
return ($r, $a->record); |
| 150 |
}; |
162 |
}; |
| 151 |
} else { |
163 |
} else { |
| 152 |
my $records = Koha::MetadataRecord::Authority->get_all_authorities_iterator(); |
164 |
my $records = Koha::MetadataRecord::Authority->get_all_authorities_iterator($offset, $length); |
| 153 |
$next = sub { |
165 |
$next = sub { |
| 154 |
$records->next(); |
166 |
$records->next(); |
| 155 |
} |
167 |
} |
| 156 |
- |
|
|