PHP Class eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FullText

Inheritance: extends eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$configuration array Full text search configuration options.
$processor eZ\Publish\Core\Persistence\TransformationProcessor Transformation processor to normalize search strings.

Public Methods

Method Description
__construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler, TransformationProcessor $processor, array $configuration = [] ) Construct from full text search configuration.
accept ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion ) : boolean Check if this criterion handler accepts to handle the given criterion.
handle ( CriteriaConverter $converter, eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, array $languageSettings ) : eZ\Publish\Core\Persistence\Database\Expression Generate query expression for a Criterion this handler accepts.

Protected Methods

Method Description
getStopWordThresholdValue ( ) : integer Returns an exact content object count threshold to ignore common terms on.
getWordExpression ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $token ) : eZ\Publish\Core\Persistence\Database\Expression Get single word query expression.
getWordIdSubquery ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $string ) : eZ\Publish\Core\Persistence\Database\SelectQuery Get subquery to select relevant word IDs.
tokenizeString ( string $string ) : array Tokenize String.

Method Details

__construct() public method

Construct from full text search configuration.
public __construct ( eZ\Publish\Core\Persistence\Database\DatabaseHandler $dbHandler, TransformationProcessor $processor, array $configuration = [] )
$dbHandler eZ\Publish\Core\Persistence\Database\DatabaseHandler
$processor eZ\Publish\Core\Persistence\TransformationProcessor
$configuration array

accept() public method

Check if this criterion handler accepts to handle the given criterion.
public accept ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion ) : boolean
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
return boolean

getStopWordThresholdValue() protected method

Common terms will be skipped if used in more then a given percentage of the total amount of content objects in the database. Percentage is defined by stopWordThresholdFactor configuration. Example: If stopWordThresholdFactor is 0.66 (66%), and a term like "the" exists in more then 66% of the content, it will ignore the phrase as it is assumed to not add any value ot the search. Caches the result for the instance used as we don't need this to be super accurate as it is based on percentage, set by stopWordThresholdFactor.
protected getStopWordThresholdValue ( ) : integer
return integer

getWordExpression() protected method

Depending on the configuration of the full text search criterion converter wildcards are either transformed into the respective LIKE queries, or everything is just compared using equal.
protected getWordExpression ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $token ) : eZ\Publish\Core\Persistence\Database\Expression
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$token string
return eZ\Publish\Core\Persistence\Database\Expression

getWordIdSubquery() protected method

Get subquery to select relevant word IDs.
protected getWordIdSubquery ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $string ) : eZ\Publish\Core\Persistence\Database\SelectQuery
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$string string
return eZ\Publish\Core\Persistence\Database\SelectQuery

handle() public method

accept() must be called before calling this method.
public handle ( CriteriaConverter $converter, eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, array $languageSettings ) : eZ\Publish\Core\Persistence\Database\Expression
$converter eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$languageSettings array
return eZ\Publish\Core\Persistence\Database\Expression

tokenizeString() protected method

Tokenize String.
protected tokenizeString ( string $string ) : array
$string string
return array

Property Details

$configuration protected property

Full text search configuration options.
protected array $configuration
return array

$processor protected property

Transformation processor to normalize search strings.
protected TransformationProcessor,eZ\Publish\Core\Persistence $processor
return eZ\Publish\Core\Persistence\TransformationProcessor