Skip to content

Commit

Permalink
Merge pull request #94 from RJacksonm1/master
Browse files Browse the repository at this point in the history
Use MAX function for relevance aggregation
  • Loading branch information
nicolaslopezj committed Jan 7, 2016
2 parents 99fa55e + df5ba7a commit f459dd3
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 @@ -202,7 +202,7 @@ protected function makeGroupBy(Builder $query)
*/
protected function addSelectsToQuery(Builder $query, array $selects)
{
$selects = new Expression('avg(' . implode(' + ', $selects) . ') as relevance');
$selects = new Expression('max(' . implode(' + ', $selects) . ') as relevance');
$query->addSelect($selects);
}

Expand Down

0 comments on commit f459dd3

Please sign in to comment.