BOOST_MODE_MULTIPLY
BOOST_MODE_MULTIPLY
Class FunctionScore.
This function can be used to handle params for queries, filter
setQuery(\Elastica\Query\AbstractQuery $query) : $this
Set the child query for this function_score query.
\Elastica\Query\AbstractQuery | $query |
setFilter(\Elastica\Filter\AbstractFilter $filter) : $this
\Elastica\Filter\AbstractFilter | $filter |
addFunction(string $functionType, array|float $functionParams, \Elastica\Query\AbstractQuery $filter = null, float $weight = null) : $this
Add a function to the function_score query.
string | $functionType | valid values are DECAY_* constants and script_score |
array|float | $functionParams | the body of the function. See documentation for proper syntax. |
\Elastica\Query\AbstractQuery | $filter | optional filter to apply to the function |
float | $weight | function weight |
None found |
addScriptScoreFunction(\Elastica\Script\AbstractScript $script, \Elastica\Query\AbstractQuery $filter = null, float $weight = null) : $this
Add a script_score function to the query.
\Elastica\Script\AbstractScript | $script | a Script object |
\Elastica\Query\AbstractQuery | $filter | an optional filter to apply to the function |
float | $weight | the weight of the function |
None found |
addDecayFunction(string $function, string $field, string $origin, string $scale, string $offset = null, float $decay = null, float $weight = null, \Elastica\Query\AbstractQuery $filter = null) : $this
Add a decay function to the query.
string | $function | see DECAY_* constants for valid options |
string | $field | the document field on which to perform the decay function |
string | $origin | the origin value for this decay function |
string | $scale | a scale to define the rate of decay for this function |
string | $offset | If defined, this function will only be computed for documents with a distance from the origin greater than this value |
float | $decay | optionally defines how documents are scored at the distance given by the $scale parameter |
float | $weight | optional factor by which to multiply the score at the value provided by the $scale parameter |
\Elastica\Query\AbstractQuery | $filter | a filter associated with this function |
None found |
addFieldValueFactorFunction( $field, $factor = null, $modifier = null, $missing = null, $weight = null, $filter = null)
$field | ||
$factor | ||
$modifier | ||
$missing | ||
$weight | ||
$filter |
None found |
addBoostFactorFunction(float $boostFactor, \Elastica\Query\AbstractQuery $filter = null)
Add a boost_factor function to the query.
float | $boostFactor | the boost factor value |
\Elastica\Query\AbstractQuery | $filter | a filter associated with this function |
None found |
addWeightFunction(float $weight, \Elastica\Query\AbstractQuery $filter = null)
float | $weight | the weight of the function |
\Elastica\Query\AbstractQuery | $filter | a filter associated with this function |
None found |
addRandomScoreFunction(\Elastica\Query\number $seed, \Elastica\Query\AbstractQuery $filter = null, float $weight = null)
Add a random_score function to the query.
\Elastica\Query\number | $seed | the seed value |
\Elastica\Query\AbstractQuery | $filter | a filter associated with this function |
float | $weight | an optional boost value associated with this function |
None found |
setBoost(float $boost) : $this
Set an overall boost value for this query.
float | $boost |
None found |
setMaxBoost(float $maxBoost) : $this
Restrict the combined boost of the function_score query and its child query.
float | $maxBoost |
None found |
setBoostMode(string $mode) : $this
The boost mode determines how the score of this query is combined with that of the child query.
string | $mode | see BOOSTMODE* constants for valid options. Default is multiply. |
None found |
setRandomScore(integer $seed = null) : $this
If set, this query will return results in random order.
integer | $seed | Set a seed value to return results in the same random order for consistent pagination. |
None found |
setScoreMode(string $mode) : $this
Set the score method.
string | $mode | see SCOREMODE* constants for valid options. Default is multiply. |
None found |
setMinScore(float $minScore) : $this
Set min_score option.
float | $minScore |
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 |