Skip to content

Commit

Permalink
Merge pull request #87 from joostbaptist/master
Browse files Browse the repository at this point in the history
Added average aggregate function to relevance scores (fixes #75)
  • Loading branch information
nicolaslopezj committed Nov 23, 2015
2 parents 8d97d2c + 708d24a commit 30453f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SearchableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function makeGroupBy(Builder $query)
*/
protected function addSelectsToQuery(Builder $query, array $selects)
{
$selects = new Expression(implode(' + ', $selects) . ' as relevance');
$selects = new Expression('avg(' . implode(' + ', $selects) . ') as relevance');
$query->addSelect($selects);
}

Expand Down

0 comments on commit 30453f6

Please sign in to comment.