Converts the params to an array. A default implementation exist to create
the an array out of the class name (last part of the class name)
and the params.
Returns
array
—
Filter array
setParam()
setParam(string $key, mixed $value) : $this
Sets (overwrites) the value at the given key.
Parameters
string
$key
Key to set
mixed
$value
Key Value
Returns
$this
setParams()
setParams(array $params) : $this
Sets (overwrites) all params of this object.
Parameters
array
$params
Parameter list
Returns
$this
addParam()
addParam(string $key, mixed $value) : $this
Adds a param to the list.
This function can be used to add an array of params
Parameters
string
$key
Param key
mixed
$value
Value to set
Returns
$this
getParam()
getParam(string $key) : mixed
Returns a specific param.
Parameters
string
$key
Key to return
Throws
\Elastica\Exception\InvalidException
If requested key is not set
Returns
mixed
—
Key value
hasParam()
hasParam(string $key) : boolean
Test if a param is set.
Parameters
string
$key
Key to test
Returns
boolean
—
True if the param is set, false otherwise
getParams()
getParams() : array
Returns the params array.
Returns
array
—
Params
__construct()
__construct(string $field)
Parameters
string
$field
setField()
setField(string $field) : $this
Set the field name from which to fetch candidate suggestions.
Parameters
string
$field
Returns
$this
setSize()
setSize(integer $size) : $this
Set the maximum corrections to be returned per suggest text token.
Parameters
integer
$size
Returns
$this
setSuggestMode()
setSuggestMode(string $mode) : $this
Parameters
string
$mode
see SUGGESTMODE* constants for options
Returns
$this
setMaxEdits()
setMaxEdits(integer $max) : $this
Parameters
integer
$max
can only be a value between 1 and 2. Defaults to 2.
Returns
$this
setPrefixLength()
setPrefixLength(integer $length) : $this
Parameters
integer
$length
defaults to 1
Returns
$this
setMinWordLength()
setMinWordLength(integer $min) : $this
Parameters
integer
$min
defaults to 4
Returns
$this
setMaxInspections()
setMaxInspections(integer $max) : $this
Parameters
integer
$max
Returns
$this
setMinDocFrequency()
setMinDocFrequency(float $min) : $this
Parameters
float
$min
Returns
$this
setMaxTermFrequency()
setMaxTermFrequency(float $max) : $this
Parameters
float
$max
Returns
$this
setPreFilter()
setPreFilter(string $pre) : $this
Set an analyzer to be applied to the original token prior to candidate generation.
Parameters
string
$pre
an analyzer
Returns
$this
setPostFilter()
setPostFilter(string $post) : $this
Set an analyzer to be applied to generated tokens before they are passed to the phrase scorer.
Parameters
string
$post
Returns
$this
_convertArrayable()
_convertArrayable(array $array) : array
Cast objects to arrays.
Parameters
array
$array
Returns
array
_getBaseName()
_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.