diff --git a/src/SearchableTrait.php b/src/SearchableTrait.php index c73d4cb..e013ecf 100644 --- a/src/SearchableTrait.php +++ b/src/SearchableTrait.php @@ -179,6 +179,9 @@ protected function addSelectsToQuery(Builder $query, array $selects) protected function filterQueryWithRelevance(Builder $query, array $selects, $relevance_count) { $comparator = $this->getDatabaseDriver() != 'mysql' ? implode(' + ', $selects) : 'relevance'; + + $relevance_count=number_format($relevance_count,2,'.',''); + $query->havingRaw("$comparator > $relevance_count"); $query->orderBy('relevance', 'desc');