diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php | 113 |
1 files changed, 62 insertions, 51 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php b/vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php index ac2d01b3..0771f370 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php +++ b/vendor/ruflin/elastica/lib/Elastica/Query/MultiMatch.php @@ -1,36 +1,35 @@ <?php - namespace Elastica\Query; /** - * Multi Match + * Multi Match. * - * @category Xodoa - * @package Elastica * @author Rodolfo Adhenawer Campagnoli Moraes <adhenawer@gmail.com> * @author Wong Wing Lun <luiges90@gmail.com> * @author Tristan Maindron <tmaindron@gmail.com> - * @link http://www.elasticsearch.org/guide/reference/query-dsl/multi-match-query.html + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html */ class MultiMatch extends AbstractQuery { - const TYPE_BEST_FIELDS = 'best_fields'; - const TYPE_MOST_FIELDS = 'most_fields'; - const TYPE_CROSS_FIELDS = 'cross_fields'; - const TYPE_PHRASE = 'phrase'; + const TYPE_BEST_FIELDS = 'best_fields'; + const TYPE_MOST_FIELDS = 'most_fields'; + const TYPE_CROSS_FIELDS = 'cross_fields'; + const TYPE_PHRASE = 'phrase'; const TYPE_PHRASE_PREFIX = 'phrase_prefix'; - const OPERATOR_OR = 'or'; - const OPERATOR_AND = 'and'; + const OPERATOR_OR = 'or'; + const OPERATOR_AND = 'and'; - const ZERO_TERM_NONE = 'none'; - const ZERO_TERM_ALL = 'all'; + const ZERO_TERM_NONE = 'none'; + const ZERO_TERM_ALL = 'all'; /** - * Sets the query + * Sets the query. * - * @param string $query Query - * @return \Elastica\Query\MultiMatch Current object + * @param string $query Query + * + * @return $this */ public function setQuery($query = '') { @@ -40,8 +39,9 @@ class MultiMatch extends AbstractQuery /** * Sets Fields to be used in the query. * - * @param array $fields Fields - * @return \Elastica\Query\MultiMatch Current object + * @param array $fields Fields + * + * @return $this */ public function setFields($fields = array()) { @@ -53,8 +53,9 @@ class MultiMatch extends AbstractQuery * * If not set, defaults to true. * - * @param boolean $useDisMax - * @return \Elastica\Query\MultiMatch Current object + * @param bool $useDisMax + * + * @return $this */ public function setUseDisMax($useDisMax = true) { @@ -66,8 +67,9 @@ class MultiMatch extends AbstractQuery * * If not set, defaults to 0.0. * - * @param float $tieBreaker - * @return \Elastica\Query\MultiMatch Current object + * @param float $tieBreaker + * + * @return $this */ public function setTieBreaker($tieBreaker = 0.0) { @@ -75,12 +77,13 @@ class MultiMatch extends AbstractQuery } /** - * Sets operator for Match Query + * Sets operator for Match Query. * * If not set, defaults to 'or' * - * @param string $operator - * @return \Elastica\Query\MultiMatch Current object + * @param string $operator + * + * @return $this */ public function setOperator($operator = 'or') { @@ -88,23 +91,25 @@ class MultiMatch extends AbstractQuery } /** - * Set field minimum should match for Match Query + * Set field minimum should match for Match Query. + * + * @param mixed $minimumShouldMatch * - * @param int $minimumShouldMatch - * @return \Elastica\Query\Match + * @return $this */ public function setMinimumShouldMatch($minimumShouldMatch) { - return $this->setParam('minimum_should_match', (int) $minimumShouldMatch); + return $this->setParam('minimum_should_match', $minimumShouldMatch); } /** - * Set zero terms query for Match Query + * Set zero terms query for Match Query. * * If not set, default to 'none' * - * @param string $zeroTermQuery - * @return \Elastica\Query\Match + * @param string $zeroTermQuery + * + * @return $this */ public function setZeroTermsQuery($zeroTermQuery = 'none') { @@ -112,10 +117,11 @@ class MultiMatch extends AbstractQuery } /** - * Set cutoff frequency for Match Query + * Set cutoff frequency for Match Query. + * + * @param float $cutoffFrequency * - * @param float $cutoffFrequency - * @return \Elastica\Query\Match + * @return $this */ public function setCutoffFrequency($cutoffFrequency) { @@ -123,11 +129,12 @@ class MultiMatch extends AbstractQuery } /** - * Set type + * Set type. * - * @param string $field - * @param string $type - * @return \Elastica\Query\Match + * @param string $field + * @param string $type + * + * @return $this */ public function setType($type) { @@ -135,10 +142,11 @@ class MultiMatch extends AbstractQuery } /** - * Set fuzziness + * Set fuzziness. + * + * @param float $fuzziness * - * @param float $fuzziness - * @return \Elastica\Query\Match + * @return $this */ public function setFuzziness($fuzziness) { @@ -146,10 +154,11 @@ class MultiMatch extends AbstractQuery } /** - * Set prefix length + * Set prefix length. * - * @param int $prefixLength - * @return \Elastica\Query\Match + * @param int $prefixLength + * + * @return $this */ public function setPrefixLength($prefixLength) { @@ -157,10 +166,11 @@ class MultiMatch extends AbstractQuery } /** - * Set max expansions + * Set max expansions. + * + * @param int $maxExpansions * - * @param int $maxExpansions - * @return \Elastica\Query\Match + * @return $this */ public function setMaxExpansions($maxExpansions) { @@ -168,10 +178,11 @@ class MultiMatch extends AbstractQuery } /** - * Set analyzer + * Set analyzer. + * + * @param string $analyzer * - * @param string $analyzer - * @return \Elastica\Query\Match + * @return $this */ public function setAnalyzer($analyzer) { |