Skip to content

Commit

Permalink
Merge pull request #44 from manavo/patch-2
Browse files Browse the repository at this point in the history
Allow 0 as a threshold, fixes #29
  • Loading branch information
nicolaslopezj committed Apr 20, 2015
2 parents 589c79a + 39acc04 commit 349079c
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 @@ -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);

Expand Down

0 comments on commit 349079c

Please sign in to comment.