diff options
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php b/vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php index 061ddafa..72b2e3aa 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php +++ b/vendor/ruflin/elastica/lib/Elastica/Aggregation/Cardinality.php @@ -1,14 +1,38 @@ <?php - namespace Elastica\Aggregation; - /** - * Class Cardinality - * @package Elastica\Aggregation - * @link http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html + * Class Cardinality. + * + * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html */ class Cardinality extends AbstractSimpleAggregation { + /** + * @param int $precisionThreshold + * + * @return $this + */ + public function setPrecisionThreshold($precisionThreshold) + { + if (!is_int($precisionThreshold)) { + throw new \InvalidArgumentException('precision_threshold only supports integer values'); + } + + return $this->setParam('precision_threshold', $precisionThreshold); + } + + /** + * @param bool $rehash + * + * @return $this + */ + public function setRehash($rehash) + { + if (!is_bool($rehash)) { + throw new \InvalidArgumentException('rehash only supports boolean values'); + } -} + return $this->setParam('rehash', $rehash); + } +} |