diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
commit | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch) | |
tree | 181f454813b310ee97385058c6c6f2e3f34d5fd8 /vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php | |
parent | 7e85254903c7c0cb49e381f16b18441ea7b058cc (diff) | |
parent | 80f7dc77d430774192b929d780f96260066df2ee (diff) |
Merge commit '80f7dc'
# Conflicts:
# extensions/ArchInterWiki.sql
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php b/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php deleted file mode 100644 index c1dab800..00000000 --- a/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -namespace Elastica\Facet; - -use Elastica\Exception\InvalidException; -use Elastica\Script; - -/** - * Implements the terms facet. - * - * @category Xodoa - * @package Elastica - * @author Nicolas Ruflin <spam@ruflin.com> - * @author Jasper van Wanrooy <jasper@vanwanrooy.net> - * @link http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet.html - */ -class Terms extends AbstractFacet -{ - /** - * Holds the types of ordering which are allowed - * by Elasticsearch. - * - * @var array - */ - protected $_orderTypes = array('count', 'term', 'reverse_count', 'reverse_term'); - - /** - * Sets the field for the terms. - * - * @param string $field The field name for the terms. - * @return \Elastica\Facet\Terms - */ - public function setField($field) - { - return $this->setParam('field', $field); - } - - /** - * Sets the script for the term. - * - * @param string $script The script for the term. - * @return \Elastica\Facet\Terms - */ - public function setScript($script) - { - $script = Script::create($script); - foreach ($script->toArray() as $param => $value) { - $this->setParam($param, $value); - } - - return $this; - } - - /** - * Sets multiple fields for the terms. - * - * @param array $fields Numerical array with the fields for the terms. - * @return \Elastica\Facet\Terms - */ - public function setFields(array $fields) - { - return $this->setParam('fields', $fields); - } - - /** - * Sets the flag to return all available terms. When they - * don't have a hit, they have a count of zero. - * - * @param bool $allTerms Flag to fetch all terms. - * @return \Elastica\Facet\Terms - */ - public function setAllTerms($allTerms) - { - return $this->setParam('all_terms', (bool) $allTerms); - } - - /** - * Sets the ordering type for this facet. Elasticsearch - * internal default is count. - * - * @param string $type The order type to set use for sorting of the terms. - * @throws \Elastica\Exception\InvalidException When an invalid order type was set. - * @return \Elastica\Facet\Terms - */ - public function setOrder($type) - { - if (!in_array($type, $this->_orderTypes)) { - throw new InvalidException('Invalid order type: ' . $type); - } - - return $this->setParam('order', $type); - } - - /** - * Set an array with terms which are omitted in the search. - * - * @param array $exclude Numerical array which includes all terms which needs to be ignored. - * @return \Elastica\Facet\Terms - */ - public function setExclude(array $exclude) - { - return $this->setParam('exclude', $exclude); - } - - /** - * Sets the amount of terms to be returned. - * - * @param int $size The amount of terms to be returned. - * @return \Elastica\Facet\Terms - */ - public function setSize($size) - { - return $this->setParam('size', (int) $size); - } - - /** - * Creates the full facet definition, which includes the basic - * facet definition of the parent. - * - * @see \Elastica\Facet\AbstractFacet::toArray() - * @return array - */ - public function toArray() - { - $this->_setFacetParam('terms', $this->_params); - - return parent::toArray(); - } -} |