From 80f7dc77d430774192b929d780f96260066df2ee Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 18 Oct 2015 09:31:31 +0200 Subject: Update to MediaWiki 1.25.3 --- .../ruflin/elastica/lib/Elastica/Filter/Terms.php | 132 --------------------- 1 file changed, 132 deletions(-) delete mode 100644 vendor/ruflin/elastica/lib/Elastica/Filter/Terms.php (limited to 'vendor/ruflin/elastica/lib/Elastica/Filter/Terms.php') diff --git a/vendor/ruflin/elastica/lib/Elastica/Filter/Terms.php b/vendor/ruflin/elastica/lib/Elastica/Filter/Terms.php deleted file mode 100644 index 2f7c88e3..00000000 --- a/vendor/ruflin/elastica/lib/Elastica/Filter/Terms.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @link http://www.elasticsearch.org/guide/reference/query-dsl/terms-filter.html - */ -class Terms extends AbstractFilter -{ - /** - * Terms - * - * @var array Terms - */ - protected $_terms = array(); - - /** - * Params - * - * @var array Params - */ - protected $_params = array(); - - /** - * Terms key - * - * @var string Terms key - */ - protected $_key = ''; - - /** - * Creates terms filter - * - * @param string $key Terms key - * @param array $terms Terms values - */ - public function __construct($key = '', array $terms = array()) - { - $this->setTerms($key, $terms); - } - - /** - * Sets key and terms for the filter - * - * @param string $key Terms key - * @param array $terms Terms for the query. - * @return \Elastica\Filter\Terms - */ - public function setTerms($key, array $terms) - { - $this->_key = $key; - $this->_terms = array_values($terms); - - return $this; - } - - /** - * Set the lookup parameters for this filter - * @param string $key terms key - * @param string|\Elastica\Type $type document type from which to fetch the terms values - * @param string $id id of the document from which to fetch the terms values - * @param string $path the field from which to fetch the values for the filter - * @param string|array|\Elastica\Index $options An array of options or the index from which to fetch the terms values. Defaults to the current index. - * @return \Elastica\Filter\Terms Filter object - */ - public function setLookup($key, $type, $id, $path, $options = array()) - { - $this->_key = $key; - if ($type instanceof \Elastica\Type) { - $type = $type->getName(); - } - $this->_terms = array( - 'type' => $type, - 'id' => $id, - 'path' => $path - ); - - $index = $options; - if(is_array($options)) { - if(isset($options['index'])) { - $index = $options['index']; - unset($options['index']); - } - $this->_terms = array_merge($options, $this->_terms); - } - - if (!is_null($index)) { - if ($index instanceof \Elastica\Index) { - $index = $index->getName(); - } - $this->_terms['index'] = $index; - } - return $this; - } - - /** - * Adds an additional term to the query - * - * @param string $term Filter term - * @return \Elastica\Filter\Terms Filter object - */ - public function addTerm($term) - { - $this->_terms[] = $term; - - return $this; - } - - /** - * Converts object to an array - * - * @see \Elastica\Filter\AbstractFilter::toArray() - * @throws \Elastica\Exception\InvalidException - * @return array data array - */ - public function toArray() - { - if (empty($this->_key)) { - throw new InvalidException('Terms key has to be set'); - } - $this->_params[$this->_key] = $this->_terms; - - return array('terms' => $this->_params); - } -} -- cgit v1.2.3-54-g00ecf