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 {
2626 type => ' author' ,
2727 body => $body ,
2828 );
29- return {} unless $authors -> {hits }{total };
3029
3130 my @authors = map {
3231 single_valued_arrayref_to_scalar( $_ -> {_source } );
3332 $_ -> {_source }
3433 } @{ $authors -> {hits }{hits } };
3534
36- return { authors => \@authors };
35+ return {
36+ authors => \@authors ,
37+ took => $authors -> {took },
38+ total => $authors -> {hits }{total },
39+ };
3740}
3841
3942sub by_user {
@@ -48,14 +51,17 @@ sub by_user {
4851 size => 500,
4952 }
5053 );
51- return {} unless $authors -> {hits }{total };
5254
5355 my @authors = map {
5456 single_valued_arrayref_to_scalar( $_ -> {_source } );
5557 $_ -> {_source }
5658 } @{ $authors -> {hits }{hits } };
5759
58- return { authors => \@authors };
60+ return {
61+ authors => \@authors ,
62+ took => $authors -> {took },
63+ total => $authors -> {hits }{total },
64+ };
5965}
6066
6167sub search {
@@ -91,7 +97,6 @@ sub search {
9197 type => ' author' ,
9298 body => $body ,
9399 );
94- return {} unless $ret -> {hits }{total };
95100
96101 my @authors = map {
97102 single_valued_arrayref_to_scalar( $_ -> {_source } );
You can’t perform that action at this time.
0 commit comments