include/SugarSearchEngine/Elastic/Elastica/Query/QueryString.php

Show: inherited
Table of Contents

QueryString query

Author
Nicolas Ruflin , Jasper van Wanrooy  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html  
Package
Elastica  
Uses
\Elastica_Query_Abstract  

\Elastica_Query_QueryString

Package: Elastica

QueryString query

This function can be used to handle params for queries, filter, facets

Parent(s)
\Elastica_Query_Abstract < \Elastica_Param
Author
Nicolas Ruflin , Jasper van Wanrooy  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html  
Uses
\Elastica_Query_Abstract  

Properties

Propertyprotectedarray  $_params= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\Elastica_Param::$$_params  
Inherited_from
\Elastica_Query_Abstract::$$_params  
Propertyprotected  $_queryString= ''''
Default value''Details
Type
n/a
Propertyprotected  $_rawParams= 'array()'
Default valuearray()Details
Type
n/a
Inherited_from
\Elastica_Param::$$_rawParams  
Inherited_from
\Elastica_Query_Abstract::$$_rawParams  

Methods

methodpublic__construct( string $queryString = '' ) : void

Creates query string object. Calls setQuery with argument

Parameters
Name Type Description
$queryString string

OPTIONAL Query string for object

methodprotected_setRawParam( string $key, mixed $value ) : \Elastica_Param
inherited

Sets params not inside params array

Inherited from: \Elastica_Param::_setRawParam()\Elastica_Query_Abstract::_setRawParam()
Parameters
Name Type Description
$key string
$value mixed
Returns
Type Description
\Elastica_Param
methodpublicaddParam( string $key, mixed $value ) : \Elastica_Param
inherited

Adds a param to the list

Inherited from: \Elastica_Param::addParam()\Elastica_Query_Abstract::addParam()

This function can be used to add an array of params

Parameters
Name Type Description
$key string

Param key

$value mixed

Value to set

Returns
Type Description
\Elastica_Param
methodpublicgetParam( string $key ) : mixed
inherited

Returns a specific param

Inherited from: \Elastica_Param::getParam()\Elastica_Query_Abstract::getParam()
Parameters
Name Type Description
$key string

Key to return

Returns
Type Description
mixed Key value
Throws
Exception Description
\Elastica_Exception_Invalid If requested key is not set
methodpublicgetParams( ) : array
inherited

Returns the params array

Inherited from: \Elastica_Param::getParams()\Elastica_Query_Abstract::getParams()
Returns
Type Description
array Params
methodpublicsetAllowLeadingWildcard( bool $allow = true ) : \Elastica_Query_QueryString

Sets the parameter to allow * and ? as first characters.

If not set, defaults to true.

Parameters
Name Type Description
$allow bool
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetAnalyzeWildcard( bool $analyze = true ) : \Elastica_Query_QueryString

Allows analyzing of wildcard terms.

If not set, defaults to false

Parameters
Name Type Description
$analyze bool
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetAnalyzer( string $analyzer ) : \Elastica_Query_QueryString

Sets the analyzer to analyze the query with.

Parameters
Name Type Description
$analyzer string

Analyser to use

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetAutoGeneratePhraseQueries( bool $autoGenerate = true ) : \Elastica_Query_QueryString

Sets the param to automatically generate phrase queries.

If not set, defaults to false.

Parameters
Name Type Description
$autoGenerate bool
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetBoost( float $boost = 1.0 ) : \Elastica_Query_QueryString

Sets the boost value of the query.

If not set, defaults to 1.0.

Parameters
Name Type Description
$boost float
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetDefaultField( string $field ) : \Elastica_Query_QueryString

Sets the default field

If no field is set, _all is chosen

Parameters
Name Type Description
$field string

Field

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetDefaultOperator( string $operator ) : \Elastica_Query_QueryString

Sets the default operator AND or OR

If no operator is set, OR is chosen

Parameters
Name Type Description
$operator string

Operator

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetEnablePositionIncrements( bool $enabled = true ) : \Elastica_Query_QueryString

Sets the paramater to enable the position increments in result queries.

If not set, defaults to true.

Parameters
Name Type Description
$enabled bool
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetFields( array $fields ) : \Elastica_Query_QueryString

Sets the fields

If no fields are set, _all is chosen

Parameters
Name Type Description
$fields array

Fields

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetFuzzyMinSim( float $minSim = 0.5 ) : \Elastica_Query_QueryString

Sets the fuzzy minimal similarity parameter.

If not set, defaults to 0.5

Parameters
Name Type Description
$minSim float
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetFuzzyPrefixLength( int $length = 0 ) : \Elastica_Query_QueryString

Sets the fuzzy prefix length parameter.

If not set, defaults to 0.

Parameters
Name Type Description
$length int
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetLowercaseExpandedTerms( bool $lowercase = true ) : \Elastica_Query_QueryString

Sets the parameter to auto-lowercase terms of some queries.

If not set, defaults to true.

Parameters
Name Type Description
$lowercase bool
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetParam( string $key, mixed $value ) : void
inherited

Sets (overwrites) the value at the given key

Inherited from: \Elastica_Param::setParam()\Elastica_Query_Abstract::setParam()
Parameters
Name Type Description
$key string

Key to set

$value mixed

Key Value

methodpublicsetParams( array $params ) : \Elastica_Param
inherited

Sets (overwrites) all params of this object

Inherited from: \Elastica_Param::setParams()\Elastica_Query_Abstract::setParams()
Parameters
Name Type Description
$params array

Parameter list

Returns
Type Description
\Elastica_Param
methodpublicsetPhraseSlop( int $phraseSlop = 0 ) : \Elastica_Query_QueryString

Sets the phrase slop.

If zero, exact phrases are required. If not set, defaults to zero.

Parameters
Name Type Description
$phraseSlop int
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetQuery( string $query = '' ) : \Elastica_Query_QueryString

Sets a new query string for the object

Parameters
Name Type Description
$query string

Query string

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetQueryString( string $queryString ) : \Elastica_Query_QueryString

Sets the default operator AND or OR

If no operator is set, OR is chosen

Parameters
Name Type Description
$queryString string

Query string

Returns
Type Description
\Elastica_Query_QueryString Current object
Details
Deprecated
Please use setQuery instead  
methodpublicsetRewrite( string $rewrite = "" ) : \Elastica_Param

Set a re-write condition. See https://github.com/elasticsearch/elasticsearch/issues/1186 for additional information

Parameters
Name Type Description
$rewrite string
Returns
Type Description
\Elastica_Param
Details
Author
Andreas Sandberg @sugarcrm Added pull request https://github.com/ruflin/Elastica/pull/141  
methodpublicsetTieBraker( int $tieBreaker = 0 ) : \Elastica_Query_QueryString

When using dis_max, the disjunction max tie breaker.

If not set, defaults to 0.

Parameters
Name Type Description
$tieBreaker int
Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublicsetUseDisMax( bool $value = true ) : \Elastica_Query_QueryString

Whether to use bool or dis_max quueries to internally combine results for multi field search.

Parameters
Name Type Description
$value bool

Determines whether to use

Returns
Type Description
\Elastica_Query_QueryString Current object
methodpublictoArray( ) : array

Converts query to array

Returns
Type Description
array Query array
Details
See
\Elastica_Param::toArray()  
Documentation was generated by DocBlox 0.18.1.