h engine
use v5.16.0;
use Moo;
with 'Search::Typesense::Role::Request';
use Mojo::JSON qw(decode_json encode_json);
use Mojo::UserAgent;
use Mojo::URL;
use Carp qw(croak);
use Search::Typesense::D
@_;
$tx->req->headers->header(
'Content-Type' => 'application/json' )
->header( 'X-TYPESENSE-API-KEY' => $key );
}
);
( json => $body ) : $body;
return $self->_handle_request( \%arg_for, \@args );
}
sub _PATCH {
my ( $self, %arg_for ) = @_;
my $body = $arg_for{body};
my @args = ref $body ? ( json =>
rl' failed: $message. $body");
}
return $arg_for->{return_transaction} ? $tx : $tx->res->json;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Search::Typesense::Role::Request - No user-s
,
query => $query,
return_transaction => 1,
) or return;
return $tx->res->json;
}
sub get {
my ( $self, $collection ) = @_;
state $check = compile(Str);
my @collec
$field->{facet} ) {
$field->{facet}
= $field->{facet} ? Mojo::JSON->true : Mojo::JSON->false;
}
}
return $self->_POST(
path => ['collections'],
uments
use v5.16.0;
use Moo;
with qw(Search::Typesense::Role::Request);
use Mojo::JSON qw(decode_json encode_json);
use Search::Typesense::Types qw(
ArrayRef
Enum
HashRef
InstanceOf
NonEm
, 'export' ],
return_transaction => 1
) or return; # 404
return [ map { decode_json($_) } split /\n/ => $tx->res->body ];
}
sub import {
my $self = shift;
state $check = c
my ( $collection, $action, $documents ) = $check->(@_);
my $body = join "\n" => map { encode_json($_) } @$documents;
my $tx = $self->_POST(
path => [ 'collections', $collection, 'do