PHP Класс yii\sphinx\MatchBuilder

См. также: MatchExpression
См. также: http://sphinxsearch.com/docs/current.html#extended-syntax
С версии: 2.0.6
Автор: Kirichenko Sergey ([email protected])
Автор: Paul Klimov ([email protected])
Наследование: extends yii\base\Object
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$db the Sphinx connection.

Защищенные свойства (Protected)

Свойство Тип Описание
$matchBuilders map of MATCH keywords to builder methods. These methods are used by [[buildMatch]] to build MATCH expression from array syntax.
$matchOperators map of MATCH operators. These operators are used for replacement of verbose operators.

Открытые методы

Метод Описание
__construct ( Connection $connection, array $config = [] ) Constructor.
build ( MatchExpression $match ) : string Generates the MATCH expression from given MatchExpression object.
buildAndMatch ( string $operator, array $operands, array &$params ) : string Connects two or more MATCH expressions with the AND or OR operator
buildHashMatch ( array $match, array &$params ) : string Creates a MATCH based on column-value pairs.
buildIgnoreMatch ( string $operator, array $operands, &$params ) : string Create ignored MATCH expressions
buildMatch ( string | array $match, array &$params ) : string Create MATCH expression.
buildMultipleMatch ( string $operator, array $operands, &$params ) : string Create MAYBE, SENTENCE or PARAGRAPH expressions.
buildProximityMatch ( string $operator, array $operands, &$params ) : string Create PROXIMITY expressions
buildSimpleMatch ( string $operator, array $operands, array &$params ) : string Creates an Match expressions like "column" operator value.
buildZoneMatch ( string $operator, array $operands, &$params ) : string Create MATCH expressions for zones.

Защищенные методы

Метод Описание
buildMatchColumn ( string $column, boolean $ignored = false ) : string Created column as string for expression of MATCH
buildMatchValue ( string | array | yii\db\Expression $value, array &$params ) : string Create placeholder for expression of MATCH
parseParams ( string $expression, array $params ) : string Returns the actual MATCH expression by inserting parameter values into the corresponding placeholders.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( Connection $connection, array $config = [] )
$connection Connection the Sphinx connection.
$config array name-value pairs that will be used to initialize the object properties

build() публичный метод

Generates the MATCH expression from given MatchExpression object.
public build ( MatchExpression $match ) : string
$match MatchExpression the [[MatchExpression]] object from which the MATCH expression will be generated.
Результат string generated MATCH expression.

buildAndMatch() публичный метод

Connects two or more MATCH expressions with the AND or OR operator
public buildAndMatch ( string $operator, array $operands, array &$params ) : string
$operator string the operator which is used for connecting the given operands
$operands array the Match expressions to connect
$params array the expression parameters to be populated
Результат string the MATCH expression

buildHashMatch() публичный метод

Creates a MATCH based on column-value pairs.
public buildHashMatch ( array $match, array &$params ) : string
$match array the match condition
$params array the expression parameters to be populated
Результат string the MATCH expression

buildIgnoreMatch() публичный метод

Create ignored MATCH expressions
public buildIgnoreMatch ( string $operator, array $operands, &$params ) : string
$operator string the operator which is used for Create Match expressions
$operands array the Match expressions
Результат string the MATCH expression

buildMatch() публичный метод

Create MATCH expression.
public buildMatch ( string | array $match, array &$params ) : string
$match string | array MATCH specification.
$params array the expression parameters to be populated
Результат string the MATCH expression

buildMatchColumn() защищенный метод

Created column as string for expression of MATCH
protected buildMatchColumn ( string $column, boolean $ignored = false ) : string
$column string column specification.
$ignored boolean whether column should be specified as 'ignored'.
Результат string the column statement.

buildMatchValue() защищенный метод

Create placeholder for expression of MATCH
protected buildMatchValue ( string | array | yii\db\Expression $value, array &$params ) : string
$value string | array | yii\db\Expression
$params array the expression parameters to be populated
Результат string the MATCH expression

buildMultipleMatch() публичный метод

Create MAYBE, SENTENCE or PARAGRAPH expressions.
public buildMultipleMatch ( string $operator, array $operands, &$params ) : string
$operator string the operator which is used for Create Match expressions
$operands array the Match expressions
Результат string the MATCH expression

buildProximityMatch() публичный метод

Create PROXIMITY expressions
public buildProximityMatch ( string $operator, array $operands, &$params ) : string
$operator string the operator which is used for Create Match expressions
$operands array the Match expressions
Результат string the MATCH expression

buildSimpleMatch() публичный метод

Creates an Match expressions like "column" operator value.
public buildSimpleMatch ( string $operator, array $operands, array &$params ) : string
$operator string the operator to use. Anything could be used e.g. `>`, `<=`, etc.
$operands array contains two column names.
$params array the expression parameters to be populated
Результат string the MATCH expression

buildZoneMatch() публичный метод

Create MATCH expressions for zones.
public buildZoneMatch ( string $operator, array $operands, &$params ) : string
$operator string the operator which is used for Create Match expressions
$operands array the Match expressions
Результат string the MATCH expression

parseParams() защищенный метод

Returns the actual MATCH expression by inserting parameter values into the corresponding placeholders.
protected parseParams ( string $expression, array $params ) : string
$expression string the expression string which is needed to prepare.
$params array the binding parameters for inserting.
Результат string parsed expression.

Описание свойств

$db публичное свойство

the Sphinx connection.
public $db

$matchBuilders защищенное свойство

map of MATCH keywords to builder methods. These methods are used by [[buildMatch]] to build MATCH expression from array syntax.
protected $matchBuilders

$matchOperators защищенное свойство

map of MATCH operators. These operators are used for replacement of verbose operators.
protected $matchOperators