コード例 #1
0
 /**
  * Get subquery to select relevant word IDs
  *
  * @param string $string
  *
  * @return \ezcQuerySelect
  */
 protected function getWordIdSubquery($query, $string)
 {
     $subQuery = $query->subSelect();
     $tokens = $this->tokenizeString($this->processor->transform($string, $this->configuration['commands']));
     $wordExpressions = array();
     foreach ($tokens as $token) {
         $wordExpressions[] = $this->getWordExpression($subQuery, $token);
     }
     $subQuery->select($this->dbHandler->quoteColumn('id'))->from($this->dbHandler->quoteTable('ezsearch_word'))->where($subQuery->expr->lAnd($subQuery->expr->lOr($wordExpressions), $subQuery->expr->lt($this->dbHandler->quoteColumn('object_count'), $subQuery->bindValue($this->configuration['searchThresholdValue']))));
     return $subQuery;
 }
コード例 #2
0
 /**
  * Construct instance of TransformationProcessor\DefinitionBased
  *
  * Through the $ruleFiles array, a list of files with full text
  * transformation rules is given. These files are parsed by
  * {@link \eZ\Publish\Core\Persistence\Legacy\Content\Search\TransformationProcessor\DefinitionBased\Parser}
  * and then used for normalization in the full text search.
  *
  * @param \eZ\Publish\Core\Persistence\Legacy\Content\Search\TransformationProcessor\DefinitionBased\Parser $parser
  * @param \eZ\Publish\Core\Persistence\Legacy\Content\Search\TransformationProcessor\PcreCompiler $compiler
  * @param array $ruleFiles
  *
  * @return \eZ\Publish\Core\Persistence\Legacy\Content\Search\TransformationProcessor\DefinitionBased
  */
 public function __construct(Parser $parser, PcreCompiler $compiler, array $ruleFiles = array())
 {
     parent::__construct($compiler, $ruleFiles);
     $this->parser = $parser;
 }
コード例 #3
0
 /**
  * Constructor
  *
  * @param \eZ\Publish\Core\Persistence\Legacy\Content\Search\TransformationProcessor\PcreCompiler $compiler
  * @param string $installDir Base dir for rule loading
  * @param array $ruleFiles
  */
 public function __construct(PcreCompiler $compiler, $installDir, array $ruleFiles = array())
 {
     parent::__construct($compiler, $ruleFiles);
     $this->installDir = $installDir;
 }