=cut
use autodie;
-use Getopt::Long;
+use Getopt::Long qw( GetOptions );
use Koha::Script;
use C4::Context;
use Koha::MetadataRecord::Authority;
use Koha::SearchEngine::Elasticsearch;
use Koha::SearchEngine::Elasticsearch::Indexer;
use MARC::Field;
-use MARC::Record;
use Modern::Perl;
-use Pod::Usage;
-use Try::Tiny;
+use Pod::Usage qw( pod2usage );
+use Try::Tiny qw( catch try );
my $verbose = 0;
my $commit = 5000;
_handle_response($response);
_log( 1, "Commit complete\n" );
} catch {
- if( ref $_ eq 'Koha::Exceptions::Elasticsearch::BadResponse'){
- _log(1,$_->{error});
- _log(2,$_->{details});
- }
+ _log(1,"Elasticsearch exception thrown: ".$_->type."\n");
+ _log(2,"Details: ".$_->details."\n");
};
$commit_count = $commit;
@id_buffer = ();