Created
August 29, 2012 23:23
-
-
Save grantm/3520281 to your computer and use it in GitHub Desktop.
Fix single colon in search queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/MetaCPAN/Web/Controller/Search.pm | |
+++ b/lib/MetaCPAN/Web/Controller/Search.pm | |
@@ -22,6 +22,9 @@ sub index : Path { | |
$query =~ s{\.pm\b}{}; | |
} | |
+ # normalise ":", "'" and "-" separators to "::" | |
+ $query =~ s{\b[:'-]\b}{::}g; | |
+ | |
my $model = $c->model('API::Module'); | |
my $from = ( $req->page - 1 ) * 20; | |
if ( $req->parameters->{lucky} ) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
let just exclude those like dist:, file:, module:, author:?