diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php | 124 |
1 files changed, 80 insertions, 44 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php b/vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php index d9ae4284..cd375db5 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php +++ b/vendor/ruflin/elastica/lib/Elastica/Query/MoreLikeThis.php @@ -1,21 +1,20 @@ <?php - namespace Elastica\Query; /** - * More Like This query + * More Like This query. * - * @category Xodoa - * @package Elastica * @author Raul Martinez, Jr <juneym@gmail.com> - * @link http://www.elasticsearch.org/guide/reference/query-dsl/mlt-query.html + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html */ class MoreLikeThis extends AbstractQuery { /** - * Adds field to mlt query + * Set fields to which to restrict the mlt query. + * + * @param array $fields Field names * - * @param array $fields Field names * @return \Elastica\Query\MoreLikeThis Current object */ public function setFields(array $fields) @@ -24,10 +23,23 @@ class MoreLikeThis extends AbstractQuery } /** - * Set the "like_text" value + * Set document ids for the mlt query. + * + * @param array $ids Document ids + * + * @return \Elastica\Query\MoreLikeThis Current object + */ + public function setIds(array $ids) + { + return $this->setParam('ids', $ids); + } + + /** + * Set the "like_text" value. + * + * @param string $likeText * - * @param string $likeText - * @return \Elastica\Query\MoreLikeThis This current object + * @return $this */ public function setLikeText($likeText) { @@ -37,10 +49,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set boost + * Set boost. * - * @param float $boost Boost value - * @return \Elastica\Query\MoreLikeThis Query object + * @param float $boost Boost value + * + * @return $this */ public function setBoost($boost) { @@ -48,10 +61,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set max_query_terms + * Set max_query_terms. + * + * @param int $maxQueryTerms Max query terms value * - * @param int $maxQueryTerms Max query terms value - * @return \Elastica\Query\MoreLikeThis + * @return $this */ public function setMaxQueryTerms($maxQueryTerms) { @@ -59,10 +73,13 @@ class MoreLikeThis extends AbstractQuery } /** - * Set percent terms to match + * Set percent terms to match. + * + * @param float $percentTermsToMatch Percentage + * + * @return $this * - * @param float $percentTermsToMatch Percentage - * @return \Elastica\Query\MoreLikeThis + * @deprecated Option "percent_terms_to_match" deprecated as of ES 1.5. Use "minimum_should_match" instead. */ public function setPercentTermsToMatch($percentTermsToMatch) { @@ -70,10 +87,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set min term frequency + * Set min term frequency. * - * @param int $minTermFreq - * @return \Elastica\Query\MoreLikeThis + * @param int $minTermFreq + * + * @return $this */ public function setMinTermFrequency($minTermFreq) { @@ -81,10 +99,11 @@ class MoreLikeThis extends AbstractQuery } /** - * set min document frequency + * set min document frequency. + * + * @param int $minDocFreq * - * @param int $minDocFreq - * @return \Elastica\Query\MoreLikeThis + * @return $this */ public function setMinDocFrequency($minDocFreq) { @@ -92,10 +111,11 @@ class MoreLikeThis extends AbstractQuery } /** - * set max document frequency + * set max document frequency. * - * @param int $maxDocFreq - * @return \Elastica\Query\MoreLikeThis + * @param int $maxDocFreq + * + * @return $this */ public function setMaxDocFrequency($maxDocFreq) { @@ -103,10 +123,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set min word length + * Set min word length. + * + * @param int $minWordLength * - * @param int $minWordLength - * @return \Elastica\Query\MoreLikeThis + * @return $this */ public function setMinWordLength($minWordLength) { @@ -114,10 +135,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set max word length + * Set max word length. * - * @param int $maxWordLength - * @return \Elastica\Query\MoreLikeThis + * @param int $maxWordLength + * + * @return $this */ public function setMaxWordLength($maxWordLength) { @@ -125,11 +147,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set boost terms + * Set boost terms. + * + * @param bool $boostTerms * - * @param bool $boostTerms - * @return \Elastica\Query\MoreLikeThis - * @link http://www.elasticsearch.org/guide/reference/query-dsl/mlt-query.html + * @return $this */ public function setBoostTerms($boostTerms) { @@ -137,10 +159,11 @@ class MoreLikeThis extends AbstractQuery } /** - * Set analyzer + * Set analyzer. * - * @param string $analyzer - * @return \Elastica\Query\MoreLikeThis + * @param string $analyzer + * + * @return $this */ public function setAnalyzer($analyzer) { @@ -150,13 +173,26 @@ class MoreLikeThis extends AbstractQuery } /** - * Set stop words + * Set stop words. + * + * @param array $stopWords * - * @param array $stopWords - * @return \Elastica\Query\MoreLikeThis + * @return $this */ public function setStopWords(array $stopWords) { return $this->setParam('stop_words', $stopWords); } + + /** + * Set minimum_should_match option. + * + * @param int|string $minimumShouldMatch + * + * @return $this + */ + public function setMinimumShouldMatch($minimumShouldMatch) + { + return $this->setParam('minimum_should_match', $minimumShouldMatch); + } } |