diff --git a/lib/MetaCPAN/ESConfig.pm b/lib/MetaCPAN/ESConfig.pm index d06a53998..954184fbe 100644 --- a/lib/MetaCPAN/ESConfig.pm +++ b/lib/MetaCPAN/ESConfig.pm @@ -1,19 +1,18 @@ use v5.20; use warnings; -use experimental qw(signatures postderef); +use experimental qw( signatures postderef ); package MetaCPAN::ESConfig; -use Carp qw(croak); -use Const::Fast qw(const); -use Exporter qw(import); -use MetaCPAN::Util qw(root_dir); -use Module::Runtime qw(require_module $module_name_rx); +use Carp qw( croak ); +use Const::Fast qw( const ); use Cpanel::JSON::XS (); -use Hash::Merge::Simple qw(merge); +use Exporter qw( import ); +use Hash::Merge::Simple qw( merge ); use MetaCPAN::Server::Config (); -use MetaCPAN::Types::TypeTiny qw(HashRef Defined); -use Const::Fast qw(const); +use MetaCPAN::Types::TypeTiny qw( Defined HashRef ); +use MetaCPAN::Util qw( root_dir ); +use Module::Runtime qw( $module_name_rx require_module ); const my %config => merge( { diff --git a/lib/MetaCPAN/Query/Release.pm b/lib/MetaCPAN/Query/Release.pm index 098a84bbd..36cdbd0ec 100644 --- a/lib/MetaCPAN/Query/Release.pm +++ b/lib/MetaCPAN/Query/Release.pm @@ -285,7 +285,7 @@ sub _activity_filters { if ( $new_dists and $new_dists eq 'n' ) { push @filters, ( - +{ term => { first => 1 } }, + +{ term => { first => true } }, +{ terms => { status => [qw( cpan latest )] } }, ); } @@ -824,15 +824,11 @@ sub recent { my $query; if ( $type eq 'n' ) { $query = { - constant_score => { - filter => { - bool => { - must => [ - { term => { first => 1 } }, - { terms => { status => [qw< cpan latest >] } }, - ] - } - } + bool => { + must => [ + { term => { first => true } }, + { terms => { status => [qw< cpan latest >] } }, + ] } }; } @@ -840,13 +836,7 @@ sub recent { $query = { match_all => {} }; } else { - $query = { - constant_score => { - filter => { - terms => { status => [qw< cpan latest >] } - } - } - }; + $query = { terms => { status => [qw< cpan latest >] } }; } my $body = { diff --git a/lib/MetaCPAN/Util.pm b/lib/MetaCPAN/Util.pm index f2fc5891c..4d2c229dd 100644 --- a/lib/MetaCPAN/Util.pm +++ b/lib/MetaCPAN/Util.pm @@ -94,11 +94,7 @@ sub fix_version { sub author_dir { my $pauseid = shift; - my $dir = 'id/' - . sprintf( "%s/%s/%s", - substr( $pauseid, 0, 1 ), - substr( $pauseid, 0, 2 ), $pauseid ); - return $dir; + return sprintf( 'id/%1$.1s/%1$.2s/%1$s', $pauseid ); } sub hit_total { diff --git a/t/release/documentation-not-readme.t b/t/release/documentation-not-readme.t index e6554aa60..89492c7ae 100644 --- a/t/release/documentation-not-readme.t +++ b/t/release/documentation-not-readme.t @@ -3,12 +3,13 @@ use warnings; use lib 't/lib'; use MetaCPAN::TestHelpers qw( test_release ); +use MetaCPAN::Util qw( true false ); use Test::More; test_release( 'RWSTAUNER/Documentation-Not-Readme-0.01', { - first => 1, + first => true, extra_tests => \&test_modules, main_module => 'Documentation::Not::Readme', } diff --git a/t/release/pod-examples.t b/t/release/pod-examples.t index 6e781857e..93bf41a3f 100644 --- a/t/release/pod-examples.t +++ b/t/release/pod-examples.t @@ -3,12 +3,13 @@ use warnings; use lib 't/lib'; use MetaCPAN::TestHelpers qw( test_release ); +use MetaCPAN::Util qw( true false ); use Test::More; test_release( 'RWSTAUNER/Pod-Examples-99', { - first => 1, + first => true, extra_tests => \&test_pod_examples, main_module => 'Pod::Examples', changes_file => 'Changes',