diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-18 06:00:00 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-18 06:00:00 +0100 |
commit | 15e69f7b20b6596b9148030acce5b59993b95a45 (patch) | |
tree | 7b828b8920b0e222dc2a2c97dde933c9c4864fab /vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.25.4
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php b/vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php new file mode 100644 index 00000000..4306fd9c --- /dev/null +++ b/vendor/ruflin/elastica/lib/Elastica/Query/Prefix.php @@ -0,0 +1,48 @@ +<?php + +namespace Elastica\Query; + +/** + * Prefix query + * + * @category Xodoa + * @package Elastica + * @link http://www.elasticsearch.org/guide/reference/query-dsl/prefix-query.html + */ +class Prefix extends AbstractQuery +{ + /** + * Constructs the Prefix query object + * + * @param array $prefix OPTIONAL Calls setRawPrefix with the given $prefix array + */ + public function __construct(array $prefix = array()) + { + $this->setRawPrefix($prefix); + } + + /** + * setRawPrefix can be used instead of setPrefix if some more special + * values for a prefix have to be set. + * + * @param array $prefix Prefix array + * @return \Elastica\Query\Prefix Current object + */ + public function setRawPrefix(array $prefix) + { + return $this->setParams($prefix); + } + + /** + * Adds a prefix to the prefix query + * + * @param string $key Key to query + * @param string|array $value Values(s) for the query. Boost can be set with array + * @param float $boost OPTIONAL Boost value (default = 1.0) + * @return \Elastica\Query\Prefix Current object + */ + public function setPrefix($key, $value, $boost = 1.0) + { + return $this->setRawPrefix(array($key => array('value' => $value, 'boost' => $boost))); + } +} |