We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 554cbe0 + 0db7140 commit 2b60e5dCopy full SHA for 2b60e5d
lib/MetaCPAN/Query/Author.pm
@@ -3,7 +3,7 @@ package MetaCPAN::Query::Author;
3
use MetaCPAN::Moose;
4
5
use MetaCPAN::ESConfig qw( es_doc_path );
6
-use MetaCPAN::Util qw(hit_total);
+use MetaCPAN::Util qw( MAX_RESULT_WINDOW hit_total );
7
use Ref::Util qw( is_arrayref );
8
9
with 'MetaCPAN::Query::Role::Common';
@@ -53,6 +53,17 @@ sub by_user {
53
sub search {
54
my ( $self, $query, $from ) = @_;
55
56
+ $from //= 0;
57
+ my $size = 10;
58
+
59
+ if ( $from * $size >= MAX_RESULT_WINDOW ) {
60
+ return +{
61
+ authors => [],
62
+ took => 0,
63
+ total => 0,
64
+ };
65
+ }
66
67
my $body = {
68
query => {
69
bool => {
@@ -74,7 +85,7 @@ sub search {
74
85
],
75
86
}
76
87
},
77
- size => 10,
88
+ size => $size,
78
89
from => $from || 0,
79
90
};
80
91
0 commit comments