protected function searchSelect(SearchableSubquery $subquery, ColumnCollection $columns, array $words)
    {
        $cases = $bindings = [];

        foreach ($columns as $column) {
            list($cases[], $binding) = $this->buildCase($column, $words);

            $bindings = array_merge_recursive($bindings, $binding);
        }

        $select = implode(' + ', $cases);

        $subquery->selectRaw("max({$select}) as relevance");

        $this->addBinding($bindings['select'], 'select');

        return $bindings['where'];
    }
protected function searchSelect(SearchableSubquery $subquery, ColumnCollection $columns, array $words)
    {
        $cases = $bindings = [];

        foreach ($columns as $column) {
            list($cases[], $binding) = $this->buildCase($column, $words);

            $bindings = array_merge_recursive($bindings, $binding);
        }

        $select = implode(' + ', $cases);

        $subquery->selectRaw("max({$select}) as relevance");

        $this->addBinding($bindings['select'], 'select');

        return $bindings['where'];
    }
protected function searchSelect ( SearchableSubquery $ subquery , ColumnCollection $ columns , array $ words ) { $ cases = $ bindings = [ ] ; foreach ( $ columns as $ column ) { list ( $ cases [ ] , $ binding ) = $ this -> buildCase ( $ column , $ words ) ; $ bindings = array_merge_recursive ( $ bindings , $ binding ) ; } $ select = implode ( ' + ' , $ cases ) ; $ subquery -> selectRaw ( "max({$select}) as relevance" ) ; $ this -> addBinding ( $ bindings [ 'select' ] , 'select' ) ; return $ bindings [ 'where' ] ; }
Apply relevance select on the subquery.

@param  \Sofa\Eloquence\Searchable\Subquery $subquery
@param  \Sofa\Eloquence\Searchable\ColumnCollection $columns
@param  array $words
@return array
Apply relevance select on the subquery .