PHP Class Elastica\Query\QueryString

Inheritance: extends AbstractQuery
Show file Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_queryString Query string.

Public Methods

Method Description
__construct ( string $queryString = '' ) Creates query string object. Calls setQuery with argument.
setAllowLeadingWildcard ( boolean $allow = true ) Sets the parameter to allow * and ? as first characters.
setAnalyzeWildcard ( boolean $analyze = true ) Allows analyzing of wildcard terms.
setAnalyzer ( string $analyzer ) Sets the analyzer to analyze the query with.
setAutoGeneratePhraseQueries ( boolean $autoGenerate = true ) Sets the param to automatically generate phrase queries.
setBoost ( float $boost = 1 ) Sets the boost value of the query.
setDefaultField ( string $field ) Sets the default field.
setDefaultOperator ( string $operator ) Sets the default operator AND or OR.
setEnablePositionIncrements ( boolean $enabled = true ) Sets the parameter to enable the position increments in result queries.
setFields ( array $fields ) Sets the fields. If no fields are set, _all is chosen.
setFuzzyMinSim ( float $minSim = 0.5 ) Sets the fuzzy minimal similarity parameter.
setFuzzyPrefixLength ( integer $length ) Sets the fuzzy prefix length parameter.
setPhraseSlop ( integer $phraseSlop ) Sets the phrase slop.
setQuery ( string $query = '' ) Sets a new query string for the object.
setRewrite ( string $rewrite = '' ) Set a re-write condition. See https://github.com/elasticsearch/elasticsearch/issues/1186 for additional information.
setTieBreaker ( integer $tieBreaker ) When using dis_max, the disjunction max tie breaker.
setTimezone ( string $timezone ) Set timezone option.
setUseDisMax ( boolean $value = true ) Whether to use bool or dis_max queries to internally combine results for multi field search.
toArray ( ) : array Converts query to array.

Method Details

__construct() public method

Creates query string object. Calls setQuery with argument.
public __construct ( string $queryString = '' )
$queryString string OPTIONAL Query string for object

setAllowLeadingWildcard() public method

If not set, defaults to true.
public setAllowLeadingWildcard ( boolean $allow = true )
$allow boolean

setAnalyzeWildcard() public method

If not set, defaults to true
public setAnalyzeWildcard ( boolean $analyze = true )
$analyze boolean

setAnalyzer() public method

Sets the analyzer to analyze the query with.
public setAnalyzer ( string $analyzer )
$analyzer string Analyser to use

setAutoGeneratePhraseQueries() public method

If not set, defaults to true.
public setAutoGeneratePhraseQueries ( boolean $autoGenerate = true )
$autoGenerate boolean

setBoost() public method

If not set, defaults to 1.0.
public setBoost ( float $boost = 1 )
$boost float

setDefaultField() public method

If no field is set, _all is chosen
public setDefaultField ( string $field )
$field string Field

setDefaultOperator() public method

If no operator is set, OR is chosen
public setDefaultOperator ( string $operator )
$operator string Operator

setEnablePositionIncrements() public method

If not set, defaults to true.
public setEnablePositionIncrements ( boolean $enabled = true )
$enabled boolean

setFields() public method

Sets the fields. If no fields are set, _all is chosen.
public setFields ( array $fields )
$fields array Fields

setFuzzyMinSim() public method

If not set, defaults to 0.5
public setFuzzyMinSim ( float $minSim = 0.5 )
$minSim float

setFuzzyPrefixLength() public method

If not set, defaults to 0.
public setFuzzyPrefixLength ( integer $length )
$length integer

setPhraseSlop() public method

If zero, exact phrases are required. If not set, defaults to zero.
public setPhraseSlop ( integer $phraseSlop )
$phraseSlop integer

setQuery() public method

Sets a new query string for the object.
public setQuery ( string $query = '' )
$query string Query string

setRewrite() public method

Set a re-write condition. See https://github.com/elasticsearch/elasticsearch/issues/1186 for additional information.
public setRewrite ( string $rewrite = '' )
$rewrite string

setTieBreaker() public method

If not set, defaults to 0.
public setTieBreaker ( integer $tieBreaker )
$tieBreaker integer

setTimezone() public method

Set timezone option.
public setTimezone ( string $timezone )
$timezone string

setUseDisMax() public method

Whether to use bool or dis_max queries to internally combine results for multi field search.
public setUseDisMax ( boolean $value = true )
$value boolean Determines whether to use

toArray() public method

Converts query to array.
See also: Elastica\Query\AbstractQuery::toArray()
public toArray ( ) : array
return array Query array

Property Details

$_queryString protected property

Query string.
protected $_queryString