Redirect to man page if there's only one search result
This commit is contained in:
parent
53857d5b84
commit
c50e864ca3
1 changed files with 2 additions and 0 deletions
|
|
@ -214,6 +214,8 @@ sub browsesearch {
|
||||||
my $q = $self->reqGet('q')||'';
|
my $q = $self->reqGet('q')||'';
|
||||||
my $man = $self->dbSearch($q, 150);
|
my $man = $self->dbSearch($q, 150);
|
||||||
|
|
||||||
|
return $self->resRedirect("/$man->[0]{name}.".substr($man->[0]{section},0,1), 'temp') if @$man == 1;
|
||||||
|
|
||||||
$self->htmlHeader(title => 'Search results for '.$q);
|
$self->htmlHeader(title => 'Search results for '.$q);
|
||||||
h1 'Search results for '.$q;
|
h1 'Search results for '.$q;
|
||||||
txt 'Note: This is just a simple case-insensitive prefix match on the man names. In the future we\'ll have more powerful search functionality. Hopefully.';
|
txt 'Note: This is just a simple case-insensitive prefix match on the man names. In the future we\'ll have more powerful search functionality. Hopefully.';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue