Query/Query.php
protected function buildScore(array $columns, $searchWordsCount)
	{
		$scores = array();
		foreach($columns as $column)
		{
			if($column['scoreFactor'] != 0 && isset($column['expression']))
			{
				$stringConvertedExpression = $this->convertToString($column['type'], $column['expression']);
				$score = $column['scoreFactor'] . '*('
						. $searchWordsCount . '*LENGTH(IFNULL(' . $stringConvertedExpression . ', \'\'))';
				for($i = 0; $i < $searchWordsCount; $i++)
				{
					$score .= ' - LENGTH(REPLACE(LOWER(IFNULL(' . $stringConvertedExpression . ', \'\')), LOWER(:p' . $i . '), \'\'))';
				}
				$score .= ')';
				$scores[] = $score;
			}
		}
		return '' . implode($scores, '+') . '';
	}
protected function buildScore(array $columns, $searchWordsCount)
	{
		$scores = array();
		foreach($columns as $column)
		{
			if($column['scoreFactor'] != 0 && isset($column['expression']))
			{
				$stringConvertedExpression = $this->convertToString($column['type'], $column['expression']);
				$score = $column['scoreFactor'] . '*('
						. $searchWordsCount . '*LENGTH(IFNULL(' . $stringConvertedExpression . ', \'\'))';
				for($i = 0; $i < $searchWordsCount; $i++)
				{
					$score .= ' - LENGTH(REPLACE(LOWER(IFNULL(' . $stringConvertedExpression . ', \'\')), LOWER(:p' . $i . '), \'\'))';
				}
				$score .= ')';
				$scores[] = $score;
			}
		}
		return '' . implode($scores, '+') . '';
	}
protected function buildScore ( array $ columns , $ searchWordsCount ) { $ scores = array ( ) ; foreach ( $ columns as $ column ) { if ( $ column [ 'scoreFactor' ] != 0 && isset ( $ column [ 'expression' ] ) ) { $ stringConvertedExpression = $ this -> convertToString ( $ column [ 'type' ] , $ column [ 'expression' ] ) ; $ score = $ column [ 'scoreFactor' ] . '*(' . $ searchWordsCount . '*LENGTH(IFNULL(' . $ stringConvertedExpression . ', \'\'))' ; for ( $ i = 0 ; $ i < $ searchWordsCount ; $ i ++ ) { $ score .= ' - LENGTH(REPLACE(LOWER(IFNULL(' . $ stringConvertedExpression . ', \'\')), LOWER(:p' . $ i . '), \'\'))' ; } $ score .= ')' ; $ scores [ ] = $ score ; } } return '' . implode ( $ scores , '+' ) . '' ; }
Build score expression

@param array $columns
@param type $searchWordsCount
@return string
Build score expression