|
Lines 124-158
sanity_check();
Link Here
|
| 124 |
my $next; |
124 |
my $next; |
| 125 |
if ($index_biblios) { |
125 |
if ($index_biblios) { |
| 126 |
_log(1, "Indexing biblios\n"); |
126 |
_log(1, "Indexing biblios\n"); |
| 127 |
if (@biblionumbers) { |
127 |
my $records = Koha::BiblioUtils->get_all_biblios_iterator( @biblionumbers ); |
| 128 |
$next = sub { |
128 |
$next = sub { |
| 129 |
my $r = shift @biblionumbers; |
129 |
$records->next(); |
| 130 |
return () unless defined $r; |
130 |
}; |
| 131 |
return ($r, Koha::BiblioUtils->get_from_biblionumber($r, item_data => 1 )); |
|
|
| 132 |
}; |
| 133 |
} else { |
| 134 |
my $records = Koha::BiblioUtils->get_all_biblios_iterator(); |
| 135 |
$next = sub { |
| 136 |
$records->next(); |
| 137 |
} |
| 138 |
} |
| 139 |
do_reindex($next, $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX); |
131 |
do_reindex($next, $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX); |
| 140 |
} |
132 |
} |
| 141 |
if ($index_authorities) { |
133 |
if ($index_authorities) { |
| 142 |
_log(1, "Indexing authorities\n"); |
134 |
_log(1, "Indexing authorities\n"); |
| 143 |
if (@biblionumbers) { |
135 |
my $records = Koha::MetadataRecord::Authority->get_all_authorities_iterator( @biblionumbers ); |
| 144 |
$next = sub { |
136 |
$next = sub { |
| 145 |
my $r = shift @biblionumbers; |
137 |
$records->next(); |
| 146 |
return () unless defined $r; |
138 |
}; |
| 147 |
my $a = Koha::MetadataRecord::Authority->get_from_authid($r); |
|
|
| 148 |
return ($r, $a->record); |
| 149 |
}; |
| 150 |
} else { |
| 151 |
my $records = Koha::MetadataRecord::Authority->get_all_authorities_iterator(); |
| 152 |
$next = sub { |
| 153 |
$records->next(); |
| 154 |
} |
| 155 |
} |
| 156 |
do_reindex($next, $Koha::SearchEngine::Elasticsearch::AUTHORITIES_INDEX); |
139 |
do_reindex($next, $Koha::SearchEngine::Elasticsearch::AUTHORITIES_INDEX); |
| 157 |
} |
140 |
} |
| 158 |
|
141 |
|
| 159 |
- |
|
|