diff --git a/src/SearchableTrait.php b/src/SearchableTrait.php index 2762016..aa9ac01 100644 --- a/src/SearchableTrait.php +++ b/src/SearchableTrait.php @@ -242,7 +242,12 @@ protected function filterQueryWithRelevance(Builder $query, array $selects, $rel $relevance_count=number_format($relevance_count,2,'.',''); - $query->havingRaw("$comparator >= $relevance_count"); + if ($this->getDatabaseDriver() == 'mysql') { + $bindings = []; + } else { + $bindings = $this->search_bindings; + } + $query->havingRaw("$comparator >= $relevance_count", $bindings); $query->orderBy('relevance', 'desc'); // add bindings to postgres @@ -339,4 +344,3 @@ protected function mergeQueries(Builder $clone, Builder $original) { $original->withoutGlobalScopes()->setBindings($mergedBindings); } } -