blib/lib/WebService/Algolia.pm

filter: Statementstmt 25.7% 92 / 357 Branchbran 0.0% 0 / 268 Conditioncond 0.0% 0 / 141 MC/DCmcdc 0.0% 0 / 94 Subroutinesub 52.7% 39 / 74 Podpod n/a totaltotal 14.0% 131 / 934 CC 182 SCAR 38.0
CC
182
Cov
12%
replace_index_object
113.4
update_index_object
113.4
update_index_key
113.4
CRAP 44.5
↑ Summary
1 package WebService::Algolia;
2 6 $WebService::Algolia::VERSION = '0.1000';
3 6 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 with 'WebService::Client';
6  
7 # VERSION
8  
9 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Storable qw(dclone);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 6 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 6 has api_key => ( is => 'ro', required => 1 );
15 6 has application_id => ( is => 'ro', required => 1 );
16 6 has batch_mode => ( is => 'rw', default => 0, init_arg => undef );
17  
18 0 ▶has '+base_url' => ( is => 'ro', default =>
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
19 0 method {
20 'https://' . $self->application_id . '.algolia.io/1'
21 6 }
22 );
23 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine BUILD: not called CC=1 SCAR=2.0
24 0 method BUILD(...) {
25 0 $self->ua->default_header('X-Algolia-Application-Id' => $self->application_id);
26 $self->ua->default_header('X-Algolia-API-Key' => $self->api_key);
27 }
28 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine get_indexes: not called CC=2 SCAR=12.4
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
29 0 method get_indexes {
30 return $self->get('/indexes');
31 }
32 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine browse_index: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
33 0 method browse_index(Str $index) {
34 return $self->get("/indexes/$index/browse");
35 }
36 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine query_index: not called CC=6 SCAR=34.9
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($query) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
37 0 method query_index(HashRef $query) {
38 0 ▶ my $index = delete $query->{index};
Branch: 1 branch
BranchTrueFalseTotal
unless $index 0 0 0
39 0 croak 'The \'index\' parameter is required' unless $index;
40 return $self->get("/indexes/$index", $query);
41 }
42 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine query_indexes: not called CC=6 SCAR=35.3
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef"))->check($queries) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef")
$Method::Signatures::mutc{"cache"}{"ArrayRef"} "Method::Signatures"->_make_constraint("ArrayRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"ArrayRef"}B= "Method::Signatures"->_make_constraint("ArrayRef")
ABresult
1X1
011
000
43 method query_indexes(ArrayRef $queries) {
44 0 $queries = [ map {
45 0 ▶ my $index = delete $_->{index};
Branch: 1 branch
BranchTrueFalseTotal
unless $index 0 0 0
46 0 croak 'The \'index\' parameter is required' unless $index;
47 0 my $uri = URI->new;
48 0 $uri->query_form( %$_ );
49 { indexName => $index, params => substr($uri, 1) };
50 0 } @$queries ];
51 return $self->post('/indexes/*/queries', { requests => $queries });
52 }
53 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine clear_index: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
54 0 method clear_index(Str $index) {
55 return $self->post("/indexes/$index/clear", {});
56 }
57 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine copy_index: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($source) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($destination) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
58 0 method copy_index(Str $source, Str $destination) {
59 return $self->post("/indexes/$source/operation", {
60 operation => 'copy',
61 destination => $destination,
62 });
63 }
64 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine move_index: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($source) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($destination) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
65 0 method move_index(Str $source, Str $destination) {
66 return $self->post("/indexes/$source/operation", {
67 operation => 'move',
68 destination => $destination,
69 });
70 }
71 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine delete_index: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
72 0 method delete_index(Str $index) {
73 return $self->delete("/indexes/$index");
74 }
75 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine get_index_settings: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
76 0 method get_index_settings(Str $index) {
77 return $self->get("/indexes/$index/settings");
78 }
79 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.5
Subroutine update_index_settings: not called CC=6 SCAR=34.9
Branch: 4 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
80 0 method update_index_settings(Str $index, $settings) {
81 return $self->put("/indexes/$index/settings", $settings);
82 }
83 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine get_index_object: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($object_id) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
84 0 method get_index_object(Str $index, Str $object_id) {
85 return $self->get("/indexes/$index/$object_id");
86 }
87 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine get_index_objects: not called CC=7 SCAR=38.3
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef"))->check($objects) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"ArrayRef"} ||= "Method::Signatures"->_make_constraint("ArrayRef")
$Method::Signatures::mutc{"cache"}{"ArrayRef"} "Method::Signatures"->_make_constraint("ArrayRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"ArrayRef"}B= "Method::Signatures"->_make_constraint("ArrayRef")
ABresult
1X1
011
000
88 method get_index_objects(ArrayRef $objects) {
89 0 $objects = [ map {
90 0 ▶ my $index = delete $_->{index};
Branch: 1 branch
BranchTrueFalseTotal
unless $index 0 0 0
91 0 croak 'The \'index\' parameter is required' unless $index;
92 0 ▶ my $object = delete $_->{object};
Branch: 1 branch
BranchTrueFalseTotal
unless $object 0 0 0
93 0 croak 'The \'object\' parameter is required' unless $object;
94 { indexName => $index, objectID => $object }
95 0 } @$objects ];
96 return $self->post('/indexes/*/objects', { requests => $objects });
97 }
98 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine create_index_object: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
99 0 method create_index_object(Str $index, HashRef $data) {
100 return $self->post("/indexes/$index", $data);
101 }
102 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=6.1
Subroutine replace_index_object: not called CC=11 SCAR=47.3
Branch: 7 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($object_id) 0 0 0
unless scalar @_ > 2 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 3 0 0 0
Condition0%0/9
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
103 0 method replace_index_object(Str $index, Str $object_id, HashRef $data) {
104 return $self->put("/indexes/$index/$object_id", $data);
105 }
106 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=6.1
Subroutine update_index_object: not called CC=11 SCAR=47.3
Branch: 7 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($object_id) 0 0 0
unless scalar @_ > 2 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 3 0 0 0
Condition0%0/9
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
107 0 method update_index_object(Str $index, Str $object_id, HashRef $data) {
108 return $self->post("/indexes/$index/$object_id/partial", $data);
109 }
110 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine delete_index_object: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($object_id) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
111 0 method delete_index_object(Str $index, Str $object_id) {
112 return $self->delete("/indexes/$index/$object_id");
113 }
114 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine batch_index_objects: not called CC=8 SCAR=41.0
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"ArrayRef[CodeRef]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[CodeRef]"))->check($operations) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"ArrayRef[CodeRef]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[CodeRef]")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"ArrayRef[CodeRef]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[CodeRef]")
$Method::Signatures::mutc{"cache"}{"ArrayRef[CodeRef]"} "Method::Signatures"->_make_constraint("ArrayRef[CodeRef]")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"ArrayRef[CodeRef]"}B= "Method::Signatures"->_make_constraint("ArrayRef[CodeRef]")
ABresult
1X1
011
000
115 0 method batch_index_objects(Str $index, ArrayRef[CodeRef] $operations) {
116 0 $self->batch_mode(1);
117 0 my $requests = [ map { $_->() } @$operations ];
118 0 $self->batch_mode(0);
119 return $self->post("/indexes/$index/batch", { requests => $requests });
120 }
121 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.0
Subroutine get_index_keys: not called CC=6 SCAR=34.4
Branch: 3 branches
BranchTrueFalseTotal
scalar @_ > 0 ? : 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
122 0 ▶method get_index_keys(Str $index = '') {
Branch: 1 branch
BranchTrueFalseTotal
$index ? : 0 0 0
123 return $index
124 ? $self->get("/indexes/$index/keys")
125 : $self->get('/indexes/*/keys');
126 }
127 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine get_index_key: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
128 0 method get_index_key(Str $index, Str $key) {
129 return $self->get("/indexes/$index/keys/$key");
130 }
131 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine create_index_key: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
132 0 method create_index_key(Str $index, HashRef $data) {
133 return $self->post("/indexes/$index/keys", $data);
134 }
135 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=6.1
Subroutine update_index_key: not called CC=11 SCAR=47.3
Branch: 7 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
unless scalar @_ > 2 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 3 0 0 0
Condition0%0/9
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
136 0 method update_index_key(Str $index, Str $key, HashRef $data) {
137 return $self->put("/indexes/$index/keys/$key", $data);
138 }
139 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine delete_index_key: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
140 0 method delete_index_key(Str $index, Str $key) {
141 return $self->delete("/indexes/$index/keys/$key");
142 }
143 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine get_task_status: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($index) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($task_id) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
144 0 method get_task_status(Str $index, Str $task_id) {
145 return $self->get("/indexes/$index/task/$task_id");
146 }
147 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine get_keys: not called CC=2 SCAR=12.4
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
148 0 method get_keys {
149 return $self->get('/keys');
150 }
151 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine get_key: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
152 0 method get_key(Str $key) {
153 return $self->get("/keys/$key");
154 }
155 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine create_key: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
156 0 method create_key(HashRef $data) {
157 return $self->post('/keys', $data);
158 }
159 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.8
Subroutine update_key: not called CC=8 SCAR=40.7
Branch: 5 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
unless scalar @_ > 1 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($data) 0 0 0
if scalar @_ > 2 0 0 0
Condition0%0/6
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
160 0 method update_key(Str $key, HashRef $data) {
161 return $self->put("/keys/$key", $data);
162 }
163 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.1
Subroutine delete_key: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($key) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
164 0 method delete_key(Str $key) {
165 return $self->delete("/keys/$key");
166 }
167 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.0
Subroutine get_logs: not called CC=5 SCAR=30.8
Branch: 3 branches
BranchTrueFalseTotal
scalar @_ > 0 ? : 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef"))->check($params) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"HashRef"} ||= "Method::Signatures"->_make_constraint("HashRef")
$Method::Signatures::mutc{"cache"}{"HashRef"} "Method::Signatures"->_make_constraint("HashRef")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"HashRef"}B= "Method::Signatures"->_make_constraint("HashRef")
ABresult
1X1
011
000
168 0 method get_logs(HashRef $params = {}) {
169 return $self->get('/logs', $params);
170 }
171 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.0
Subroutine get_popular_searches: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
scalar @_ > 0 ? : 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]"))->check($indexes) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} "Method::Signatures"->_make_constraint("ArrayRef[Str]")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"}B= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
ABresult
1X1
011
000
172 0 method get_popular_searches(ArrayRef[Str] $indexes = []) {
173 0 my $csv_indexes = join ',', @$indexes;
174 return $self->get(_analytics_uri("/searches/$csv_indexes/popular"));
175 }
176 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.0
Subroutine get_unpopular_searches: not called CC=5 SCAR=31.0
Branch: 3 branches
BranchTrueFalseTotal
scalar @_ > 0 ? : 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]"))->check($indexes) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} ||= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
$Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"} "Method::Signatures"->_make_constraint("ArrayRef[Str]")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"ArrayRef[Str]"}B= "Method::Signatures"->_make_constraint("ArrayRef[Str]")
ABresult
1X1
011
000
177 0 method get_unpopular_searches(ArrayRef[Str] $indexes = []) {
178 0 my $csv_indexes = join ',', @$indexes;
179 return $self->get(_analytics_uri("/searches/$csv_indexes/noresults"));
180 }
181 6 ▶ 
Subroutine BEGIN: called CC=1 SCAR=5.0
Subroutine _analytics_uri: not called CC=5 SCAR=30.8
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 0 0
unless ($Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str"))->check($uri) 0 0 0
if scalar @_ > 1 0 0 0
Condition0%0/3
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
l!l&&r!l&&!r
000
MC/DC0%0/2
$Method::Signatures::mutc{"cache"}{"Str"} ||= "Method::Signatures"->_make_constraint("Str")
$Method::Signatures::mutc{"cache"}{"Str"} "Method::Signatures"->_make_constraint("Str")
Truth table0%0/3
A ||= B
A= $Method::Signatures::mutc{"cache"}{"Str"}B= "Method::Signatures"->_make_constraint("Str")
ABresult
1X1
011
000
182 0 func _analytics_uri(Str $uri) {
183 return "https://analytics.algolia.com/1$uri";
184 }
185 6  
186 for my $func (qw/put post delete/) {
187 0 ▶ around $func => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
188 0 ▶ my ($orig, $self, @args) = @_;
Branch: 1 branch
BranchTrueFalseTotal
if ($self->batch_mode) { } 0 0 0
189 0 if ($self->batch_mode) {
190 my ($path, $body) = @args;
191 0 return {
192 method => uc $func,
193 path => "/1$path",
194 (body => $body) x!! $body,
195 };
196 0 } else {
197 return $self->$orig(@args);
198 18 }
199 };
200 }
201  
202 # ABSTRACT: Algolia API Bindings
203  
204 6  
205 1;
206  
207 __END__
208  
209 =pod
210  
211 =encoding UTF-8
212  
213 =head1 NAME
214  
215 WebService::Algolia - Algolia API Bindings
216  
217 =head1 VERSION
218  
219 version 0.1000
220  
221 =head1 SYNOPSIS
222  
223 use WebService::Algolia;
224  
225 my $alg = WebService::Algolia->new(
226 application_id => '12345',
227 api_key => 'abcde',
228 );
229  
230 $alg->get_indexes;
231  
232 =head1 DESCRIPTION
233  
234 This module provides bindings for the
235 L<Algolia|https://www.algolia.com/doc> API.
236  
237 =for markdown [![Build Status](https://travis-ci.org/aanari/WebService-Algolia.svg?branch=master)](https://travis-ci.org/aanari/WebService-Algolia)
238  
239 =head1 METHODS
240  
241 =head2 new
242  
243 Instantiates a new WebService::Algolia client object.
244  
245 my $alg = WebService::Algolia->new(
246 application_id => $application_id,
247 api_key => $api_key,
248 timeout => $retries, # optional
249 retries => $retries, # optional
250 );
251  
252 B<Parameters>
253  
254 =over 4
255  
256 =item - C<application_id>
257  
258 I<Required>E<10> E<8>
259  
260 A valid Algolia application ID for your account.
261  
262 =item - C<api_key>
263  
264 I<Required>E<10> E<8>
265  
266 A valid Algolia api key for your account.
267  
268 =item - C<timeout>
269  
270 I<Optional>E<10> E<8>
271  
272 The number of seconds to wait per request until timing out. Defaults to C<10>.
273  
274 =item - C<retries>
275  
276 I<Optional>E<10> E<8>
277  
278 The number of times to retry requests in cases when Lob returns a 5xx response. Defaults to C<0>.
279  
280 =back
281  
282 =head2 get_indexes
283  
284 Returns a list of all existing indexes.
285  
286 B<Request:>
287  
288 get_indexes();
289  
290 B<Response:>
291  
292 [{
293 createdAt => "2014-12-03T23:20:19.745Z",
294 dataSize => 42,
295 entries => 1,
296 lastBuildTimeS => 0,
297 name => "foo",
298 pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
299 updatedAt => "2014-12-04T00:41:14.120Z",
300 },
301 {
302 createdAt => "2014-12-03T23:20:18.323Z",
303 dataSize => 36,
304 entries => 1,
305 lastBuildTimeS => 0,
306 name => "bar",
307 pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
308 updatedAt => "2014-12-04T00:42:13.231Z",
309 }]
310  
311 =head2 browse_index
312  
313 Returns all content from an index.
314  
315 B<Request:>
316  
317 browse_index('foo');
318  
319 B<Response:>
320  
321 {
322 hits => [{ bar => { baz => "bat" }, objectID => 5333220 }],
323 hitsPerPage => 1000,
324 nbHits => 1,
325 nbPages => 1,
326 page => 0,
327 params => "hitsPerPage=1000&attributesToHighlight=&attributesToSnippet=&attributesToRetrieve=*",
328 processingTimeMS => 1,
329 query => "",
330 }
331  
332 =head2 query_index
333  
334 Returns objects that match the query.
335  
336 B<Request:>
337  
338 query_index({ index => 'foo', query => 'bat' });
339  
340 B<Response:>
341  
342 {
343 hits => [
344 { _highlightResult => {
345 bar => {
346 baz => {
347 matchedWords => [ "bat" ],
348 matchLevel => "full",
349 value => "<em>bat</em>"
350 },
351 },
352 },
353 bar => { baz => "bat" },
354 objectID => 5333370,
355 },
356 ],
357 hitsPerPage => 20,
358 nbHits => 1,
359 nbPages => 1,
360 page => 0,
361 params => "query=bat",
362 processingTimeMS => 1,
363 query => "bat",
364 }
365  
366 =head2 query_indexes
367  
368 Query multiple indexes with one API call.
369  
370 B<Request:>
371  
372 query_indexes([
373 { index => 'foo', query => 'baz' },
374 { index => 'foo', query => 'bat' },
375 ]);
376  
377 B<Response:>
378  
379 {
380 results => [
381 { hits => [],
382 hitsPerPage => 20,
383 index => "foo",
384 nbHits => 0,
385 nbPages => 0,
386 page => 0,
387 params => "query=baz",
388 processingTimeMS => 1,
389 query => "baz",
390 },
391 { hits => [
392 { _highlightResult => {
393 bar => {
394 baz => {
395 matchedWords => [ "bat" ],
396 matchLevel => "full",
397 value => "<em>bat</em>"
398 },
399 },
400 },
401 bar => { baz => "bat" },
402 objectID => 5333380,
403 },
404 ],
405 hitsPerPage => 20,
406 index => "foo",
407 nbHits => 1,
408 nbPages => 1,
409 page => 0,
410 params => "query=bat",
411 processingTimeMS => 1,
412 query => "bat",
413 },
414 ],
415 }
416  
417 =head2 clear_index
418  
419 Deletes the index content. Settings and index specific API keys are kept untouched.
420  
421 B<Request:>
422  
423 clear_index('foo');
424  
425 B<Response:>
426  
427 {
428 taskID => 26036480,
429 updatedAt => "2014-12-04T00:53:40.957Z",
430 }
431  
432 =head2 copy_index
433  
434 Copies an existing index. If the destination index already exists, its specific API keys will be preserved and the source index specific API keys will be added.
435  
436 B<Request:>
437  
438 copy_index('foo' => 'foo2');
439  
440 B<Response:>
441  
442 {
443 taskID => 26071750,
444 updatedAt => "2014-12-04T01:16:20.307Z",
445 }
446  
447 =head2 move_index
448  
449 Moves an existing index. If the destination index already exists, its specific API keys will be preserved and the source index specific API keys will be added.
450  
451 B<Request:>
452  
453 move_index('foo' => 'foo2');
454  
455 B<Response:>
456  
457 {
458 taskID => 26079100,
459 updatedAt => "2014-12-04T01:21:01.815Z",
460 }
461  
462 =head2 delete_index
463  
464 Deletes an existing index.
465  
466 B<Request:>
467  
468 delete_index('foo');
469  
470 B<Response:>
471  
472 {
473 taskID => 26040530,
474 deletedAt => "2014-12-04T00:56:00.773Z",
475 }
476  
477 =head2 get_index_settings
478  
479 Retrieves index settings.
480  
481 B<Request:>
482  
483 get_index_settings('foo');
484  
485 B<Response:>
486  
487 {
488 'attributeForDistinct' => undef,
489 'attributesForFaceting' => undef,
490 'attributesToHighlight' => undef,
491 'attributesToIndex' => [ 'bat' ],
492 'attributesToRetrieve' => undef,
493 'attributesToSnippet' => undef,
494 'customRanking' => undef,
495 'highlightPostTag' => '</em>',
496 'highlightPreTag' => '<em>',
497 'hitsPerPage' => 20,
498 'minWordSizefor1Typo' => 4,
499 'minWordSizefor2Typos' => 8,
500 'optionalWords' => undef,
501 'queryType' => 'prefixLast',
502 'ranking' => [
503 'typo',
504 'geo',
505 'words',
506 'proximity',
507 'attribute',
508 'exact',
509 'custom'
510 ],
511 'removeWordsIfNoResults' => 'none',
512 'separatorsToIndex' => '',
513 'unretrievableAttributes' => undef
514 }
515  
516 =head2 update_index_settings
517  
518 Updates part of an index's settings.
519  
520 B<Request:>
521  
522 update_index_settings('foo', { attributesToIndex => ['bat'] });
523  
524 B<Response:>
525  
526 {
527 taskID => 27224430,
528 updatedAt => "2014-12-04T19:52:29.54Z",
529 }
530  
531 =head2 create_index_object
532  
533 Creates a new object in the index, and automatically assigns an Object ID.
534  
535 B<Request:>
536  
537 create_index_object('foo', { bar => { baz => 'bat' }});
538  
539 B<Response:>
540  
541 {
542 objectID => 5333250,
543 taskID => 26026500,
544 createdAt => "2014-12-04T00:47:21.781Z",
545 }
546  
547 =head2 get_index_object
548  
549 Returns one object from the index.
550  
551 B<Request:>
552  
553 get_index_object('foo', 5333250);
554  
555 B<Response:>
556  
557 {
558 objectID => 5333250,
559 delicious => 'limoncello',
560 }
561  
562 =head2 get_index_objects
563  
564 Retrieve several objects with one API call.
565  
566 B<Request:>
567  
568 get_index_objects([
569 { index => 'foo', object => 5333250 },
570 { index => 'foo', object => 5333251 },
571 ]);
572  
573 B<Response:>
574  
575 {
576 results => [{
577 objectID => 5333250,
578 delicious => 'limoncello',
579 },
580 {
581 objectID => 5333251,
582 terrible => 'cabbage',
583 }],
584 }
585  
586 =head2 replace_index_object
587  
588 Creates or replaces an object (if the object does not exist, it will be created). When an object already exists for the specified object ID, the whole object is replaced: existing attributes that are not replaced are deleted.
589  
590 B<Request:>
591  
592 replace_index_object('foo', 5333250, { delicious => 'limoncello' });
593  
594 B<Response:>
595  
596 {
597 objectID => 5333250,
598 taskID => 26034540,
599 updatedAt => "2014-12-04T00:52:32.416Z",
600 }
601  
602 =head2 update_index_object
603  
604 Updates part of an object (if the object does not exist, it will be created. You can avoid an automatic creation of the object by passing C<createIfNotExists=false> as a query argument).
605  
606 B<Request:>
607  
608 update_index_object('foo', 5333251, { another => 'pilsner?' });
609  
610 B<Response:>
611  
612 {
613 objectID => 5333251,
614 taskID => 29453760,
615 updatedAt => "2014-12-06T02:49:40.859Z",
616 }
617  
618 =head2 delete_index_object
619  
620 Deletes an existing object from the index.
621  
622 B<Request:>
623  
624 delete_index_object('foo', 5333251);
625  
626 B<Response:>
627  
628 {
629 objectID => 5333251,
630 taskID => 29453761,
631 deletedAt => "2014-12-11T02:49:40.859Z",
632 }
633  
634 =head2 batch_index_objects
635  
636 To reduce the amount of time spent on network round trips, you can create, update, or delete several objects in one call, using the batch endpoint (all operations are done in the given order).
637  
638 The following methods can be passed into the C<batch_index_objects> method as anonymous subroutines: C<create_index_object>, C<update_index_object>, C<replace_index_object>, and C<delete_index_object>.
639  
640 B<Request:>
641  
642 my $batch = alg->batch_index_objects('foo', [
643 sub { alg->create_index_object('foo', { hello => 'world' })},
644 sub { alg->create_index_object('foo', { goodbye => 'world' })},
645 ]);
646  
647 B<Response:>
648  
649 {
650 objectIDs => [5698830, 5698840],
651 taskID => 40684520,
652 }
653  
654 B<Request:>
655  
656 my $batch = alg->batch_index_objects('foo', [
657 sub { alg->update_index_object('foo', 5698830, { 1 => 2 })},
658 sub { alg->update_index_object('foo', 5698840, { 3 => 4 })},
659 ]);
660  
661 B<Response:>
662  
663 {
664 objectIDs => [5698830, 5698840],
665 taskID => 40684521,
666 }
667  
668 B<Request:>
669  
670 my $batch = alg->batch_index_objects('foo', [
671 sub { alg->delete_index_object('foo', 5698830 )},
672 sub { alg->delete_index_object('foo', 5698840 )},
673 ]);
674  
675 B<Response:>
676  
677 {
678 objectIDs => [5698830, 5698840],
679 taskID => 40684522,
680 }
681  
682 =head2 get_index_keys
683  
684 If an indexName is passed, retrieves API keys that have access to this index with their rights. Otherwise, retrieves all API keys that have access to one index with their rights.
685  
686 B<Request:>
687  
688 get_index_keys();
689  
690 B<Response:>
691  
692 {
693 keys => [
694 {
695 acl => [],
696 index => "pirouette",
697 validity => 0,
698 value => "181b9114149666398628faa37b31cc8d",
699 },
700 {
701 acl => ['browse'],
702 index => "gelato",
703 validity => 0,
704 value => "1428a48214792ac9f6324a823991aa4c",
705 },
706 ],
707 }
708  
709 B<Request:>
710  
711 get_index_keys('pirouette');
712  
713 B<Response:>
714  
715 {
716 keys => [
717 {
718 acl => [],
719 validity => 0,
720 value => "181b9114149666398628faa37b31cc8d",
721 }
722 ],
723 }
724  
725 =head2 get_index_key
726  
727 Returns the rights of a given index specific API key that has been created with the add index specific key API.
728  
729 B<Request:>
730  
731 get_index_key('pirouette', '181b9114149666398628faa37b31cc8d');
732  
733 B<Response:>
734  
735 {
736 acl => [],
737 validity => 0,
738 value => "181b9114149666398628faa37b31cc8d",
739 }
740  
741 =head2 create_index_key
742  
743 Adds a new key that can access this index.
744  
745 B<Request:>
746  
747 create_index_key('pirouette', { acl => ['search']});
748  
749 B<Response:>
750  
751 {
752 createdAt => "2014-12-08T15:54:22.464Z",
753 key => "181b9114149666398628faa37b31cc8d",
754 }
755  
756 =head2 update_index_key
757  
758 Updates a key that can access this index.
759  
760 B<Request:>
761  
762 update_index_key('pirouette', '181b9114149666398628faa37b31cc8d', { acl => ['search', 'browse']});
763  
764 B<Response:>
765  
766 {
767 updatedAt => "2014-12-08T16:39:11.9Z",
768 key => "181b9114149666398628faa37b31cc8d",
769 }
770  
771 =head2 delete_index_key
772  
773 Deletes an index specific API key that has been created with the add index specific key API.
774  
775 B<Request:>
776  
777 delete_index_key('pirouette', '181b9114149666398628faa37b31cc8d');
778  
779 B<Response:>
780  
781 {
782 deletedAt => "2014-12-08T16:40:49.86Z",
783 }
784  
785 =head2 get_task_status
786  
787 Retrieves the status of a given task (published or notPublished). Also returns a C<pendingTask> flag that indicates if the index has remaining task(s) running.
788  
789 B<Request:>
790  
791 get_task_status('foo', 29734242);
792  
793 B<Response:>
794  
795 {
796 pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
797 status => "published",
798 }
799  
800 =head2 get_keys
801  
802 Retrieves global API keys with their rights. These keys have been created with the add global key API.
803  
804 B<Request:>
805  
806 get_keys();
807  
808 B<Response:>
809  
810 {
811 keys => [
812 {
813 acl => [],
814 validity => 0,
815 value => "28b555c212728a7f462fe96c0e677539",
816 },
817 {
818 acl => [],
819 validity => 0,
820 value => "6ef88c72a6a4fc7e660f8819f111697c",
821 }
822 ],
823 }
824  
825 =head2 get_key
826  
827 Returns the rights of a given global API key that has been created with the add global Key API.
828  
829 B<Request:>
830  
831 get_key('28b555c212728a7f462fe96c0e677539');
832  
833 B<Response:>
834  
835 {
836 acl => [],
837 validity => 0,
838 value => "28b555c212728a7f462fe96c0e677539",
839 }
840  
841 =head2 update_key
842  
843 Updates a global API key.
844  
845 B<Request:>
846  
847 update_key('28b555c212728a7f462fe96c0e677539', { acl => ['search', 'browse']});
848  
849 B<Response:>
850  
851 {
852 updatedAt => "2014-12-08T16:39:11.9Z",
853 key => "28b555c212728a7f462fe96c0e677539",
854 }
855  
856 =head2 delete_key
857  
858 Deletes a global API key that has been created with the add global Key API.
859  
860 B<Request:>
861  
862 delete_key('28b555c212728a7f462fe96c0e677539');
863  
864 B<Response:>
865  
866 {
867 deletedAt => "2014-12-08T16:40:49.86Z",
868 }
869  
870 =head2 get_logs
871  
872 Return last logs.
873  
874 B<Request:>
875  
876 get_logs();
877  
878 B<Response:>
879  
880 {
881 logs => [
882 {
883 answer => "\n{\n \"keys\": [\n ]\n}\n",
884 answer_code => 200,
885 ip => "199.91.170.132",
886 method => "GET",
887 nb_api_calls => 1,
888 processing_time_ms => 1,
889 query_body => "",
890 query_headers => "TE: deflate,gzip;q=0.3\nConnection: TE, close\nHost: 9KV4OFXW8Z.algolia.io\nUser-Agent: libwww-perl/6.08\nContent-Type: application/json\nX-Algolia-API-Key: 28d*****************************\nX-Algolia-Application-Id: 9KV4OFXW8Z\n",
891 sha1 => "b82f8d002ccae799f6629300497725faa670cc7b",
892 timestamp => "2014-12-09T05:08:05Z",
893 url => "/1/keys",
894 },
895 {
896 answer => "\n{\n \"value\": \"3bfccc91bb844f5ba0fc816449a9d340\",\n \"acl\": [\n \"search\"\n ],\n \"validity\": 0\n}\n",
897 answer_code => 200,
898 ip => "199.91.170.132",
899 method => "GET",
900 nb_api_calls => 1,
901 processing_time_ms => 1,
902 query_body => "",
903 query_headers => "TE: deflate,gzip;q=0.3\nConnection: TE, close\nHost: 9KV4OFXW8Z.algolia.io\nUser-Agent: libwww-perl/6.08\nContent-Type: application/json\nX-Algolia-API-Key: 28d*****************************\nX-Algolia-Application-Id: 9KV4OFXW8Z\n",
904 sha1 => "4915e88a309ea42f8f0ee46c9358b57b9a37a3d9",
905 timestamp => "2014-12-09T05:08:04Z",
906 url => "/1/keys/3bfccc91bb844f5ba0fc816449a9d340",
907 },
908 ],
909 }
910  
911 B<Request:>
912  
913 get_logs({
914 offset => 4,
915 length => 2,
916 });
917  
918 B<Response:>
919  
920 {
921 logs => [
922 {
923 answer => "\n{\n \"message\": \"Key does not exist\"\n}\n",
924 answer_code => 404,
925 index => "pirouette",
926 ip => "50.243.54.51",
927 method => "GET",
928 nb_api_calls => 1,
929 processing_time_ms => 1,
930 query_body => "",
931 query_headers => "TE: deflate,gzip;q=0.3\nConnection: TE, close\nHost: 9KV4OFXW8Z.algolia.io\nUser-Agent: libwww-perl/6.07\nContent-Type: application/json\nX-Algolia-API-Key: 28d*****************************\nX-Algolia-Application-Id: 9KV4OFXW8Z\n",
932 sha1 => "e2d3de10f69d8efb16caadaa22c6312ac408ed48",
933 timestamp => "2014-12-08T16:06:32Z",
934 url => "/1/indexes/pirouette/keys/25c005baabd13ab5c3ac14a79c9d5c27",
935 },
936 {
937 answer => "\n{\n \"message\": \"Key does not exist\"\n}\n",
938 answer_code => 404,
939 index => "pirouette",
940 ip => "50.243.54.51",
941 method => "GET",
942 nb_api_calls => 1,
943 processing_time_ms => 1,
944 query_body => "",
945 query_headers => "TE: deflate,gzip;q=0.3\nConnection: TE, close\nHost: 9KV4OFXW8Z.algolia.io\nUser-Agent: libwww-perl/6.07\nContent-Type: application/json\nX-Algolia-API-Key: 28d*****************************\nX-Algolia-Application-Id: 9KV4OFXW8Z\n",
946 sha1 => "d0799be3ccf05d2d5a0c902f6e80917468d5e6ff",
947 timestamp => "2014-12-08T16:06:07Z",
948 url => "/1/indexes/pirouette/keys/b7fbe3bcc26322af222edf2a9ca934ee",
949 },
950 ],
951 }
952  
953 =head2 get_popular_searches
954  
955 Return popular queries for a set of indices.
956  
957 B<Request:>
958  
959 get_popular_searches(['foo']);
960  
961 B<Response:>
962  
963 {
964 lastSearchAt => "2014-12-09T05:00:00.000Z",
965 searchCount => 48,
966 topSearches => [
967 {
968 avgHitCount => 0,
969 avgHitCountWithoutTypos => 0,
970 count => 32,
971 query => "bat"
972 },
973 ],
974 }
975  
976 =head2 get_unpopular_searches
977  
978 Return queries matching 0 records for a set of indices.
979  
980 B<Request:>
981  
982 get_unpopular_searches(['foo']);
983  
984 B<Response:>
985  
986 {
987 lastSearchAt => "2014-12-09T05:00:00.000Z",
988 searchCount => 48,
989 topSearchesNoResuls => [ { count => 16, query => "baz" } ],
990 }
991  
992 =head1 SEE ALSO
993  
994 L<https://www.algolia.com/doc> - the API documentation for L<https://www.algolia.com>.
995  
996 =head1 BUGS
997  
998 Please report any bugs or feature requests on the bugtracker website
999 https://github.com/aanari/WebService-Algolia/issues
1000  
1001 When submitting a bug or request, please include a test-file or a
1002 patch to an existing test-file that illustrates the bug or desired
1003 feature.
1004  
1005 =head1 AUTHOR
1006  
1007 Ali Anari <ali@anari.me>
1008  
1009 =head1 COPYRIGHT AND LICENSE
1010  
1011 This software is copyright (c) 2014 by Ali Anari.
1012  
1013 This is free software; you can redistribute it and/or modify it under
1014 the same terms as the Perl 5 programming language system itself.
1015  
1016 =cut
↑ Summary