Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use function_score in autocomplete
  • Loading branch information
andreeap committed Mar 19, 2015
1 parent 4488d18 commit c776371
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/MetaCPAN/Document/File.pm
Expand Up @@ -1015,9 +1015,12 @@ sub autocomplete {
# As of 2013-10-27 we are still using 0.20.2 in production.
return $self->query(
{
custom_score => {
query => { bool => { should => $should } },
script => "_score - doc['documentation'].value.length()/100",
function_score => {
query => { bool => { should => $should } },
script_score => {
script =>
"_score - doc['documentation'].value.length()/100",
}
}
}
)->filter(
Expand Down

0 comments on commit c776371

Please sign in to comment.