rch
$ catmandu import JSON to OpenSearch --bag catmandu < data.json
# Export data from OpenSearch
$ catmandu export OpenSearch --bag catmandu to JSON > data.json
# Export only one re
ore, C<search> in this case:
$ catmandu import JSON to search --bag mybag < data.json
$ catmandu export search --bag mybag to JSON > data.json
=head1 CQL MAPPING
Catmandu::Store::OpenSearch s
C<search> in this case:
$ catmandu export search --bag book -q 'title any blablabla' to JSON > data.json
=head1 COMPATIBILITY
This perl client works with the current Opensearch server 7.* at the
:OpenSearch::Searcher;
our $VERSION = '0.03';
use Catmandu::Sane;
use Moo;
use Cpanel::JSON::XS qw(encode_json);
use Types::Standard qw(Int HashRef InstanceOf);
use namespace::clean;
use feature qw(
arch(%args);
if ($res->code ne "200") {
Catmandu::Error->throw(encode_json($res->error));
}
$docs = $res->data->{hits}{hits};
retur
dex, query => $self->query);
if ($res->code ne "200") {
Catmandu::Error->throw(encode_json($res->error));
}
my $count = $res->data->{count};
$count -= $self->start;
Bag;
use Catmandu::Sane;
our $VERSION = '0.03';
use Catmandu::Hits;
use Cpanel::JSON::XS qw(encode_json decode_json);
use Catmandu::Store::OpenSearch::Searcher;
use Catmandu::Store::OpenSearch::CQL
::Error->throw("unable to create index: ".encode_json($res->error));
} else {
Catmandu::Error->throw("unable to create index: ".encode_json($res->error));
}
1;
}
sub default_buff
throw(encode_json($res));
};
}
if (is_string($cb) && $cb eq 'log') {
return sub {
my ($action, $res, $i) = @_;
$self->log->error(encode_json($res));