diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php b/vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php index a6c4ba9d..c2302d44 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php +++ b/vendor/ruflin/elastica/lib/Elastica/Query/SimpleQueryString.php @@ -1,20 +1,19 @@ <?php - namespace Elastica\Query; /** - * Class SimpleQueryString - * @package Elastica\Query - * @link http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html + * Class SimpleQueryString. + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html */ class SimpleQueryString extends AbstractQuery { - const OPERATOR_AND = "and"; - const OPERATOR_OR = "or"; + const OPERATOR_AND = 'and'; + const OPERATOR_OR = 'or'; /** * @param string $query - * @param array $fields + * @param array $fields */ public function __construct($query, array $fields = array()) { @@ -25,41 +24,60 @@ class SimpleQueryString extends AbstractQuery } /** - * Set the querystring for this query + * Set the querystring for this query. + * * @param string $query see ES documentation for querystring syntax - * @return \Elastica\Query\SimpleQueryString + * + * @return $this */ public function setQuery($query) { - return $this->setParam("query", $query); + return $this->setParam('query', $query); } /** * @param string[] $fields the fields on which to perform this query. Defaults to index.query.default_field. - * @return \Elastica\Query\SimpleQueryString + * + * @return $this */ public function setFields(array $fields) { - return $this->setParam("fields", $fields); + return $this->setParam('fields', $fields); } /** - * Set the default operator to use if no explicit operator is defined in the query string + * Set the default operator to use if no explicit operator is defined in the query string. + * * @param string $operator see OPERATOR_* constants for options - * @return \Elastica\Query\SimpleQueryString + * + * @return $this */ public function setDefaultOperator($operator) { - return $this->setParam("default_operator", $operator); + return $this->setParam('default_operator', $operator); } /** - * Set the analyzer used to analyze each term of the query + * Set the analyzer used to analyze each term of the query. + * * @param string $analyzer - * @return \Elastica\Query\SimpleQueryString + * + * @return $this */ public function setAnalyzer($analyzer) { - return $this->setParam("analyzer", $analyzer); + return $this->setParam('analyzer', $analyzer); + } + + /** + * Set minimum_should_match option. + * + * @param int|string $minimumShouldMatch + * + * @return $this + */ + public function setMinimumShouldMatch($minimumShouldMatch) + { + return $this->setParam('minimum_should_match', $minimumShouldMatch); } -}
\ No newline at end of file +} |