Skip to content

Commit

Permalink
only include listed fields in autocomplete output
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Nov 21, 2016
1 parent d716031 commit 36bdb1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Server/Controller/Search/Autocomplete.pm
Expand Up @@ -17,7 +17,8 @@ sub get : Local : Path('') : Args(0) {
my $model = $self->model($c);
$model = $model->fields( [qw(documentation release author distribution)] )
unless $model->fields;
my $data = $model->autocomplete( $c->req->param("q") )->raw->all;
my $data
= $model->autocomplete( $c->req->param("q") )->source(0)->raw->all;

single_valued_arrayref_to_scalar( $_->{fields} )
for @{ $data->{hits}{hits} };
Expand Down

0 comments on commit 36bdb1e

Please sign in to comment.