PHP Class Elastica\Query\Common

Inheritance: extends AbstractQuery
Datei anzeigen Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_field string
$_queryParams array

Public Methods

Method Description
__construct ( string $field, string $query, float $cutoffFrequency )
setAnalyzer ( string $analyzer ) Set the analyzer for this query.
setBoost ( float $boost ) Set the boost for this query.
setCutoffFrequency ( float $frequency ) Set the frequency below which terms will be put in the low frequency group.
setDisableCoord ( boolean $disable = true ) Enable / disable computation of score factor based on the fraction of all query terms contained in the document.
setField ( string $field ) Set the field on which to query.
setHighFrequencyOperator ( string $operator ) Set the logic operator for high frequency terms.
setLowFrequencyOperator ( string $operator ) Set the logic operator for low frequency terms.
setMinimumShouldMatch ( integer | string $minimum ) Set the minimum_should_match parameter.
setQuery ( string $query ) Set the query string for this query.
setQueryParam ( string $key, mixed $value ) Set a parameter in the body of this query.
toArray ( ) : array

Method Details

__construct() public method

public __construct ( string $field, string $query, float $cutoffFrequency )
$field string the field on which to query
$query string the query string
$cutoffFrequency float percentage in decimal form (.001 == 0.1%)

setAnalyzer() public method

Set the analyzer for this query.
public setAnalyzer ( string $analyzer )
$analyzer string

setBoost() public method

Set the boost for this query.
public setBoost ( float $boost )
$boost float

setCutoffFrequency() public method

Set the frequency below which terms will be put in the low frequency group.
public setCutoffFrequency ( float $frequency )
$frequency float percentage in decimal form (.001 == 0.1%)

setDisableCoord() public method

Enable / disable computation of score factor based on the fraction of all query terms contained in the document.
public setDisableCoord ( boolean $disable = true )
$disable boolean disable_coord is false by default

setField() public method

Set the field on which to query.
public setField ( string $field )
$field string the field on which to query

setHighFrequencyOperator() public method

Set the logic operator for high frequency terms.
public setHighFrequencyOperator ( string $operator )
$operator string see OPERATOR_* class constants for options

setLowFrequencyOperator() public method

Set the logic operator for low frequency terms.
public setLowFrequencyOperator ( string $operator )
$operator string see OPERATOR_* class constants for options

setMinimumShouldMatch() public method

Set the minimum_should_match parameter.
public setMinimumShouldMatch ( integer | string $minimum )
$minimum integer | string minimum number of low frequency terms which must be present

setQuery() public method

Set the query string for this query.
public setQuery ( string $query )
$query string

setQueryParam() public method

Set a parameter in the body of this query.
public setQueryParam ( string $key, mixed $value )
$key string parameter key
$value mixed parameter value

toArray() public method

public toArray ( ) : array
return array

Property Details

$_field protected_oe property

protected string $_field
return string

$_queryParams protected_oe property

protected array $_queryParams
return array