From d06e2280020c264b9ebf2e30e2ccd6bbc6241cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ferna=CC=81ndez?= Date: Tue, 16 Jun 2015 13:45:22 +0200 Subject: [PATCH] fix when not using decimal points for numbers --- src/SearchableTrait.php | 3 +++ 1 file changed, 3 insertions(+) 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');