PHP Class Elastica\Query\Terms

Inheritance: extends AbstractQuery
显示文件 Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_key Terms key.
$_terms Terms.

Public Methods

Method Description
__construct ( string $key = '', array $terms = [] ) Construct terms query.
addTerm ( string $term ) Adds a single term to the list.
setMinimumMatch ( integer | string $minimum ) Sets the minimum matching values.
setTerms ( string $key, array $terms ) Sets key and terms for the query.
toArray ( ) : array Converts the terms object to an array.

Method Details

__construct() public method

Construct terms query.
public __construct ( string $key = '', array $terms = [] )
$key string OPTIONAL Terms key
$terms array OPTIONAL Terms list

addTerm() public method

Adds a single term to the list.
public addTerm ( string $term )
$term string Term

setMinimumMatch() public method

Sets the minimum matching values.
public setMinimumMatch ( integer | string $minimum )
$minimum integer | string Minimum value

setTerms() public method

Sets key and terms for the query.
public setTerms ( string $key, array $terms )
$key string Terms key
$terms array Terms for the query.

toArray() public method

Converts the terms object to an array.
See also: Elastica\Query\AbstractQuery::toArray()
public toArray ( ) : array
return array Query array

Property Details

$_key protected_oe property

Terms key.
protected $_key

$_terms protected_oe property

Terms.
protected $_terms