Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Talina06 committed Jul 6, 2014
1 parent 492f636 commit ee40301
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/MetaCPAN/Document/Author.pm
Expand Up @@ -159,13 +159,14 @@ sub validate {

sub authorsearch {
my ( $self, @terms ) = @_;
my $query = join( " ", @terms );
my $empty = q{ };
my $query = join( $empty, @terms );

This comment has been minimized.

Copy link
@oalders

oalders Jul 7, 2014

Member

my $query = join q{ }, @terms;

join() is built in, so you don't need to use parentheses. That's a good way to distinguish built-in functions from ones we're importing.

return $self unless $query;
return $self->query(
{
custom_score => {
query => { bool => { should => $query } },
script => "_score - doc['name'].value.length()/100",
script => '_score - doc[\'name\'].value.length()/100',
}
}
)->filter(
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Search/AuthorSearch.pm
Expand Up @@ -16,7 +16,7 @@ sub get : Local : Path('') : Args(0) {
my $model = $self->model($c);
$model = $model->fields( [qw(name pauseid gravatar_url)] )
unless $model->fields;
my $data = $model->authorsearch( $c->req->param("q") )->raw;
my $data = $model->authorsearch( $c->req->param('q') )->raw;
$c->stash( $data->all );
}

Expand Down

0 comments on commit ee40301

Please sign in to comment.