Skip to content

Commit c395227

Browse files
committed
Set th "size" of resultset to be the same as input size.
Otherwise Elasticsearch returns 10 hits by default. Since this 'by_author_and_names' routine is the backend of '/feed/recent' and responds up to 100 hits, this tweak can reduce the amount of roundtrip bteewn frontend and backend.
1 parent 12c6f2b commit c395227

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/MetaCPAN/Query/Release.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ sub by_author_and_names {
363363
# $releases: ArrayRef[ Dict[ author => Str, name => Str ] ]
364364

365365
my $body = {
366+
size => (0+ @$releases),
366367
query => {
367368
bool => {
368369
should => [

0 commit comments

Comments
 (0)