Skip to content
Snippets Groups Projects
Commit f09714d2 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added cli option target-version

parent 450dc6d6
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ sub description {
}
sub opt_spec {
return(
["target-version|V" => "get current elasticsearch version"],
["verbose|v" => "enable verbose output"],
["debug" => "enable user agent debug output"],
["datemode" => hidden => {one_of => [
......@@ -80,6 +81,14 @@ sub validate_args {
sub execute {
my ($self, $opt, $args) = @_;
if ($opt->{target_version}) {
say SLUB::LZA::TA::Archivematica::Elasticsearch::version_elasticsearch(
$SLUB::LZA::TA::config{elasticsearchprotocol},
$SLUB::LZA::TA::config{elasticsearchhost},
$SLUB::LZA::TA::config{elasticsearchport}
);
exit (0);
}
my $maxrecords="10";
if (exists $opt->{maxrecords}) {
$maxrecords = $opt->{maxrecords};
......@@ -89,21 +98,22 @@ sub execute {
$startrecord = $opt->{startrecord};
}
my $query = SLUB::LZA::TA::Archivematica::Elasticsearch::prepare_query($opt);
use Data::Printer;
p(%SLUB::LZA::TA::config);
#p(%SLUB::LZA::TA::config);
my $response = SLUB::LZA::TA::Archivematica::Elasticsearch::query_elasticsearch(
$SLUB::LZA::TA::config{elasticsearchprotocol},
$SLUB::LZA::TA::config{elasticsearchhost},
$SLUB::LZA::TA::config{elasticsearchport},
'aips', # indexname
$query, # query_hash
$query, # query_hash ref
);
#my $query = SLUB::LZA::TA::Rosetta::common_sru::prepare_query($opt);
#my $response = SLUB::LZA::TA::Rosetta::SRU::sru_search('ie', $query, $startrecord, $maxrecords, $opt->{verbose}, $opt->{debug}, $opt->{user}, $opt->{password});
say $response;
use Data::Printer;
p($response);
# use Data::Printer;
# p($response);
return 1;
}
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment