$_params
$_params : array
Params.
Elastica query object.
Creates different types of queries
__construct(array|\Elastica\Query\AbstractQuery $query = null)
Creates a query object.
array|\Elastica\Query\AbstractQuery | $query | OPTIONAL Query object (default = null) |
setQuery(\Elastica\Query\AbstractQuery $query) : $this
Sets the query.
\Elastica\Query\AbstractQuery | $query | Query object |
getQuery() : \Elastica\Query\AbstractQuery
Gets the query object.
setFilter(\Elastica\Query\AbstractQuery $filter) : $this
Set Filter.
\Elastica\Query\AbstractQuery | $filter | Filter object |
setFrom(integer $from) : $this
Sets the start from which the search results should be returned.
integer | $from |
None found |
setSort(array $sortArgs) : $this
Sets sort arguments for the query Replaces existing values.
array | $sortArgs | Sorting arguments |
None found |
addSort(mixed $sort) : $this
Adds a sort param to the query.
mixed | $sort | Sort parameter |
None found |
setHighlight(array $highlightArgs) : $this
Sets highlight arguments for the query.
array | $highlightArgs | Set all highlight arguments |
None found |
addHighlight(mixed $highlight) : $this
Adds a highlight argument.
mixed | $highlight | Add highlight argument |
None found |
setSize(integer $size = 10) : $this
Sets maximum number of results for this query.
integer | $size | OPTIONAL Maximal number of results for query (default = 10) |
None found |
setLimit(integer $limit = 10) : $this
Alias for setSize.
integer | $limit | OPTIONAL Maximal number of results for query (default = 10) |
None found |
setExplain(boolean $explain = true) : $this
Enables explain on the query.
boolean | $explain | OPTIONAL Enabled or disable explain (default = true) |
None found |
setVersion(boolean $version = true) : $this
Enables version on the query.
boolean | $version | OPTIONAL Enabled or disable version (default = true) |
None found |
setFields(array $fields) : $this
Sets the fields to be returned by the search NOTICE php will encode modified(or named keys) array into object format in json format request so the fields array must a sequence(list) type of array.
array | $fields | Fields to be returned |
None found |
setFieldDataFields(array $fieldDataFields) : $this
Sets the fields not stored to be returned by the search.
array | $fieldDataFields | Fields not stored to be returned |
None found |
setScriptFields(array|\Elastica\Script\ScriptFields $scriptFields) : $this
Set script fields.
array|\Elastica\Script\ScriptFields | $scriptFields | Script fields |
None found |
addScriptField(string $name, \Elastica\Script\AbstractScript $script) : $this
Adds a Script to the query.
string | $name | |
\Elastica\Script\AbstractScript | $script | Script object |
None found |
addAggregation(\Elastica\Aggregation\AbstractAggregation $agg) : $this
Adds an Aggregation to the query.
\Elastica\Aggregation\AbstractAggregation | $agg |
None found |
setMinScore(float $minScore) : $this
Allows filtering of documents based on a minimum score.
float | $minScore | Minimum score to filter documents by |
None found |
setSuggest(\Elastica\Suggest $suggest) : $this
Add a suggest term.
\Elastica\Suggest | $suggest | suggestion object |
None found |
setRescore(mixed $rescore) : $this
Add a Rescore.
mixed | $rescore | suggestion object |
None found |
setSource(array|boolean $params) : $this
Sets the _source field to be returned with every hit.
array|boolean | $params | Fields to be returned or false to disable source |
None found |
setPostFilter(array|\Elastica\Query\AbstractQuery $filter) : $this
Sets post_filter argument for the query. The filter is applied after the query has executed.
array|\Elastica\Query\AbstractQuery | $filter |
None found |
_convertArrayable(array $array) : array
Cast objects to arrays.
array | $array |
None found |
_getBaseName() : string
Param's name Picks the last part of the class name and makes it snake_case You can override this method if you want to change the name.
name
None found |
_setRawParam(string $key, mixed $value) : $this
Sets params not inside params array.
string | $key | |
mixed | $value |
None found |