Skip to content

Commit

Permalink
get reliable scoring for module find and download_url
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Jan 24, 2017
1 parent 001537c commit d470df9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/MetaCPAN/Document/File/Set.pm
Expand Up @@ -76,7 +76,7 @@ sub find {
{ 'mime' => { order => 'asc' } },
{ 'stat.mtime' => { order => 'desc' } }
]
)->size(100)->all;
)->search_type('dfs_query_then_fetch')->size(100)->all;

my ($file) = grep {
grep { $_->indexed && $_->authorized && $_->name eq $module }
Expand Down Expand Up @@ -308,7 +308,8 @@ sub find_download_url {
}

return $self->size(1)->query($query)
->source( [ 'download_url', 'date', 'status' ] )->sort( \@sort );
->source( [ 'download_url', 'date', 'status' ] )
->search_type('dfs_query_then_fetch')->sort( \@sort );
}

sub _version_filters {
Expand Down

0 comments on commit d470df9

Please sign in to comment.