Skip to content

Commit

Permalink
grab metacpan-web patches since the "fork"
Browse files Browse the repository at this point in the history
these are the commits that were taken

a15e24e51cabd710eca6a24c1c5214732101ef85 - boost (haarg)
4302a53b1d0a08cf5a41dcf19e9142877f366b13 - splice (oalders)
  • Loading branch information
jberger committed Nov 20, 2016
1 parent 95c9e35 commit 3089322
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/MetaCPAN/Server/Model/Search.pm
Expand Up @@ -110,7 +110,11 @@ sub search_collapsed {
&& $data->{hits}->{total}
&& $data->{hits}->{total} > $hits + ( $run - 2 ) * $RESULTS_PER_RUN );

@distributions = splice( @distributions, $from, $page_size );
# Avoid "splice() offset past end of array" warning.
@distributions
= $from > @distributions
? ()
: splice( @distributions, $from, $page_size );

# Everything else will fail (slowly and quietly) without distributions.
return {} unless @distributions;
Expand Down Expand Up @@ -193,15 +197,15 @@ sub build_query {
term => {
'documentation' => {
value => $query,
boost => 100
boost => 20,
}
}
},
{
term => {
'module.name' => {
value => $query,
boost => 100
boost => 20,
}
}
},
Expand Down

0 comments on commit 3089322

Please sign in to comment.