We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2465f5c commit b875c47Copy full SHA for b875c47
lib/MetaCPAN/Document/File/Set.pm
@@ -559,11 +559,14 @@ sub autocomplete_using_suggester {
559
( $_->{fields}{documentation}[0] => $_->{fields}{distribution}[0] )
560
} @{ $data->{hits}{hits} };
561
562
- my $exact = delete $valid{$query};
+ # remove any exact match, it will be added later
563
+ my $exact;
564
+ $exact = $query if defined delete $valid{$query};
565
566
my $favorites
567
= $self->agg_by_distributions( [ values %valid ] )->{favorites};
568
569
+ no warnings 'uninitialized';
570
my @sorted = sort {
571
$favorites->{ $valid{$b} } <=> $favorites->{ $valid{$a} }
572
|| $docs{$b} <=> $docs{$a}
0 commit comments