Skip to content

Commit

Permalink
Merge branch 'master' into mickey/use_rating_by_distribution_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Jul 5, 2017
2 parents d33002f + edcbaa6 commit 4e6091f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Web/Controller/Recent.pm
Expand Up @@ -21,7 +21,7 @@ sub index : Path : Args(0) {
{
recent => $data->{releases},
took => $data->{took},
total => $data->{hits}->{total},
total => $data->{total},
template => 'recent.html',
page_size => $page_size,
}
Expand Down
11 changes: 4 additions & 7 deletions lib/MetaCPAN/Web/Controller/Recent/TopUploaders.pm
Expand Up @@ -33,13 +33,10 @@ sub topuploaders : Private {
$c->stash(
{
authors => [
sort { $b->{releases} <=> $a->{releases} } map {
{
%{ $_->{_source} },
releases =>
$data->{counts}{ $_->{_source}->{pauseid} }
}
} @{ $authors->{hits}{hits} }
sort { $b->{releases} <=> $a->{releases} }
map +{ %{$_},
releases => $data->{counts}{ $_->{pauseid} } },
@{ $authors->{authors} }
],
took => $data->{took},
total => $data->{total},
Expand Down
13 changes: 1 addition & 12 deletions lib/MetaCPAN/Web/Model/API/Author.pm
Expand Up @@ -32,18 +32,7 @@ sub get {
return $self->request( '/author/' . uc( $author[0] ) )
if ( @author == 1 );

return $self->request(
'/author/_search',
{
query => {
constant_score => {
filter => { ids => { values => [ map {uc} @author ] } }
}
},
size => scalar @author,
}
);

return $self->request( '/author/by_ids', { id => \@author } );
}

sub search {
Expand Down

0 comments on commit 4e6091f

Please sign in to comment.