1<?php
2
3namespace Elastica\Aggregation;
4
5/**
6 * Class Cardinality.
7 *
8 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html
9 */
10class Cardinality extends AbstractSimpleAggregation
11{
12    use Traits\MissingTrait;
13
14    public const DEFAULT_PRECISION_THRESHOLD_VALUE = 3000;
15
16    /**
17     * @return $this
18     */
19    public function setPrecisionThreshold(int $precisionThreshold): self
20    {
21        return $this->setParam('precision_threshold', $precisionThreshold);
22    }
23
24    /**
25     * @return $this
26     */
27    public function setRehash(bool $rehash): self
28    {
29        return $this->setParam('rehash', $rehash);
30    }
31}
32