protected function buildSubquery(array $words, array $mappings, $threshold)
    {
        $subquery = new SearchableSubquery($this->query->newQuery(), $this->model->getTable());

        $columns = $this->joinForSearch($mappings, $subquery);

        $threshold = (is_null($threshold))
                        ? array_sum($columns->getWeights()) / 4
                        : (float) $threshold;

        $subquery->select($this->model->getTable() . '.*')
                 ->from($this->model->getTable())
                 ->groupBy($this->model->getQualifiedKeyName());

        $this->addSearchClauses($subquery, $columns, $words, $threshold);

        return $subquery;
    }
protected function buildSubquery(array $words, array $mappings, $threshold)
    {
        $subquery = new SearchableSubquery($this->query->newQuery(), $this->model->getTable());

        $columns = $this->joinForSearch($mappings, $subquery);

        $threshold = (is_null($threshold))
                        ? array_sum($columns->getWeights()) / 4
                        : (float) $threshold;

        $subquery->select($this->model->getTable() . '.*')
                 ->from($this->model->getTable())
                 ->groupBy($this->model->getQualifiedKeyName());

        $this->addSearchClauses($subquery, $columns, $words, $threshold);

        return $subquery;
    }
protected function buildSubquery ( array $ words , array $ mappings , $ threshold ) { $ subquery = new SearchableSubquery ( $ this -> query -> newQuery ( ) , $ this -> model -> getTable ( ) ) ; $ columns = $ this -> joinForSearch ( $ mappings , $ subquery ) ; $ threshold = ( is_null ( $ threshold ) ) ? array_sum ( $ columns -> getWeights ( ) ) / 4 : ( float ) $ threshold ; $ subquery -> select ( $ this -> model -> getTable ( ) . '.*' ) -> from ( $ this -> model -> getTable ( ) ) -> groupBy ( $ this -> model -> getQualifiedKeyName ( ) ) ; $ this -> addSearchClauses ( $ subquery , $ columns , $ words , $ threshold ) ; return $ subquery ; }
Build the search subquery.

@param  array $words
@param  array $mappings
@param  float $threshold
@return \Sofa\Eloquence\Searchable\Subquery
Build the search subquery .