protected function filterQueryWithRelevance(&$query, $relevance_count)
{
$total = 0;
$totalColumns = 0;
$this->totalWords = $this->totalWords > 0 ? $this->totalWords : 1;
foreach ($this->getColumns() as $column => $relevance) {
$totalColumns++;
$total += $relevance * $this->totalWords;
}
$query->havingRaw('relevance >= ' . $total / ($this->totalWords + $totalColumns));
$query->orderBy('relevance', 'desc');
}