File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,17 @@ sub by_ids {
26
26
type => ' author' ,
27
27
body => $body ,
28
28
);
29
- return {} unless $authors -> {hits }{total };
30
29
31
30
my @authors = map {
32
31
single_valued_arrayref_to_scalar( $_ -> {_source } );
33
32
$_ -> {_source }
34
33
} @{ $authors -> {hits }{hits } };
35
34
36
- return { authors => \@authors };
35
+ return {
36
+ authors => \@authors ,
37
+ took => $authors -> {took },
38
+ total => $authors -> {hits }{total },
39
+ };
37
40
}
38
41
39
42
sub by_user {
@@ -48,14 +51,17 @@ sub by_user {
48
51
size => 500,
49
52
}
50
53
);
51
- return {} unless $authors -> {hits }{total };
52
54
53
55
my @authors = map {
54
56
single_valued_arrayref_to_scalar( $_ -> {_source } );
55
57
$_ -> {_source }
56
58
} @{ $authors -> {hits }{hits } };
57
59
58
- return { authors => \@authors };
60
+ return {
61
+ authors => \@authors ,
62
+ took => $authors -> {took },
63
+ total => $authors -> {hits }{total },
64
+ };
59
65
}
60
66
61
67
sub search {
@@ -91,7 +97,6 @@ sub search {
91
97
type => ' author' ,
92
98
body => $body ,
93
99
);
94
- return {} unless $ret -> {hits }{total };
95
100
96
101
my @authors = map {
97
102
single_valued_arrayref_to_scalar( $_ -> {_source } );
You can’t perform that action at this time.
0 commit comments