diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php b/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php index c1dab800..6af8867b 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php +++ b/vendor/ruflin/elastica/lib/Elastica/Facet/Terms.php @@ -1,5 +1,4 @@ <?php - namespace Elastica\Facet; use Elastica\Exception\InvalidException; @@ -8,11 +7,11 @@ 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 + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html + * @deprecated Facets are deprecated and will be removed in a future release. You are encouraged to migrate to aggregations instead. */ class Terms extends AbstractFacet { @@ -27,8 +26,9 @@ class Terms extends AbstractFacet /** * Sets the field for the terms. * - * @param string $field The field name for the terms. - * @return \Elastica\Facet\Terms + * @param string $field The field name for the terms. + * + * @return $this */ public function setField($field) { @@ -38,8 +38,9 @@ class Terms extends AbstractFacet /** * Sets the script for the term. * - * @param string $script The script for the term. - * @return \Elastica\Facet\Terms + * @param string $script The script for the term. + * + * @return $this */ public function setScript($script) { @@ -54,8 +55,9 @@ class Terms extends AbstractFacet /** * Sets multiple fields for the terms. * - * @param array $fields Numerical array with the fields for the terms. - * @return \Elastica\Facet\Terms + * @param array $fields Numerical array with the fields for the terms. + * + * @return $this */ public function setFields(array $fields) { @@ -66,8 +68,9 @@ class Terms extends AbstractFacet * 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 + * @param bool $allTerms Flag to fetch all terms. + * + * @return $this */ public function setAllTerms($allTerms) { @@ -78,14 +81,16 @@ class Terms extends AbstractFacet * 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. + * @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 + * + * @return $this */ public function setOrder($type) { if (!in_array($type, $this->_orderTypes)) { - throw new InvalidException('Invalid order type: ' . $type); + throw new InvalidException('Invalid order type: '.$type); } return $this->setParam('order', $type); @@ -94,8 +99,9 @@ class Terms extends AbstractFacet /** * 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 + * @param array $exclude Numerical array which includes all terms which needs to be ignored. + * + * @return $this */ public function setExclude(array $exclude) { @@ -105,8 +111,9 @@ class Terms extends AbstractFacet /** * Sets the amount of terms to be returned. * - * @param int $size The amount of terms to be returned. - * @return \Elastica\Facet\Terms + * @param int $size The amount of terms to be returned. + * + * @return $this */ public function setSize($size) { @@ -118,6 +125,7 @@ class Terms extends AbstractFacet * facet definition of the parent. * * @see \Elastica\Facet\AbstractFacet::toArray() + * * @return array */ public function toArray() |