diff --git a/src/SearchableTrait.php b/src/SearchableTrait.php index 53ac354..32604fd 100644 --- a/src/SearchableTrait.php +++ b/src/SearchableTrait.php @@ -52,7 +52,7 @@ public function scopeSearch(Builder $q, $search, $threshold = null) } $this->addSelectsToQuery($query, $selects); - $this->filterQueryWithRelevance($query, $selects, $threshold ?: ($relevance_count / 4)); + $this->filterQueryWithRelevance($query, $selects, !is_null($threshold)? $threshold: ($relevance_count / 4)); $this->makeGroupBy($query);