include/SugarSearchEngine/Elastic/Elastica/Query/MoreLikeThis.php
More Like This query
- Author
- Raul Martinez, Jr
- Category
- Xodoa
- Link
- http://www.elasticsearch.org/guide/reference/query-dsl/mlt-query.html
- Package
- Elastica
- Uses
- \Elastica_Query_Abstract
\Elastica_Query_MoreLikeThis
Package: Elastica
Parameters
Returns
More Like This query
This function can be used to handle params for queries, filter, facets
- Parent(s)
- \Elastica_Query_Abstract < \Elastica_Param
- Author
- Raul Martinez, Jr
- Category
- Xodoa
- Link
- http://www.elasticsearch.org/guide/reference/query-dsl/mlt-query.html
- Uses
- \Elastica_Query_Abstract
Properties

array
$_params= 'array()'
Default value
array()Details- Type
- array
- Inherited_from
- \Elastica_Param::$$_params
- Inherited_from
- \Elastica_Query_Abstract::$$_params

$_rawParams= 'array()'
Default value
array()Details- Type
- n/a
- Inherited_from
- \Elastica_Param::$$_rawParams
- Inherited_from
- \Elastica_Query_Abstract::$$_rawParams
Methods

_setRawParam(
string $key, mixed $value
)
:
\Elastica_Param
inherited
Sets params not inside params array
Inherited from: \Elastica_Param::_setRawParam()\Elastica_Query_Abstract::_setRawParam()
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Elastica_Param |

addParam(
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
| Name | Type | Description |
|---|---|---|
| $key | string | Param key |
| $value | mixed | Value to set |
| Type | Description |
|---|---|
| \Elastica_Param |

getParam(
string $key
)
:
mixed
inherited
Returns a specific param
Inherited from: \Elastica_Param::getParam()\Elastica_Query_Abstract::getParam()
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $key | string | Key to return |
| Type | Description |
|---|---|
| mixed | Key value |
| Exception | Description |
|---|---|
| \Elastica_Exception_Invalid | If requested key is not set |

getParams(
)
:
array
inherited
Returns the params array
Inherited from: \Elastica_Param::getParams()\Elastica_Query_Abstract::getParams()
Returns
| Type | Description |
|---|---|
| array | Params |

setAnalyzer(
string $analyzer
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $analyzer | string |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setBoost(
float $boost
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $boost | float | Boost value |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis | Query object |

setBoostTerms(
bool $boostTerms
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
Details
| Name | Type | Description |
|---|---|---|
| $boostTerms | bool |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setFields(
array $fields
)
:
\Elastica_Query_MoreLikeThisAdds field to mlt query
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $fields | array | Field names |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis | Current object |

setLikeText(
string $likeText
)
:
\Elastica_Query_MoreLikeThisSet the "like_text" value
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $likeText | string |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis | This current object |

setMaxDocFrequency(
int $maxDocFreq
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $maxDocFreq | int |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setMaxQueryTerms(
int $maxQueryTerms
)
:
\Elastica_Query_MoreLikeThisSet max_query_terms
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $maxQueryTerms | int | Max query terms value |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setMaxWordLength(
int $maxWordLength
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $maxWordLength | int |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setMinDocFrequency(
int $minDocFreq
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $minDocFreq | int |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setMinTermFrequency(
int $minTermFreq
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $minTermFreq | int |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setMinWordLength(
int $minWordLength
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $minWordLength | int |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setParam(
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 |

setParams(
array $params
)
:
\Elastica_Param
inherited
Sets (overwrites) all params of this object
Inherited from: \Elastica_Param::setParams()\Elastica_Query_Abstract::setParams()
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $params | array | Parameter list |
| Type | Description |
|---|---|
| \Elastica_Param |

setPercentTermsToMatch(
float $percentTermsToMatch
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $percentTermsToMatch | float | Percentage |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

setStopWords(
array $stopWords
)
:
\Elastica_Query_MoreLikeThis
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $stopWords | array |
| Type | Description |
|---|---|
| \Elastica_Query_MoreLikeThis |

toArray(
)
:
array
inherited
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
Inherited from: \Elastica_Param::toArray()\Elastica_Query_Abstract::toArray()
Returns
| Type | Description |
|---|---|
| array | Filter array |