public function cardinality($alias, $field = null, $script = null, $precision = null, $rehash = null)
    {
        $aggregation = new CardinalityAggregation($alias);

        $aggregation->setField($field);

        $aggregation->setScript($script);

        $aggregation->setPrecisionThreshold($precision);

        $aggregation->setRehash($rehash);

        $this->append($aggregation);
    }
public function cardinality($alias, $field = null, $script = null, $precision = null, $rehash = null)
    {
        $aggregation = new CardinalityAggregation($alias);

        $aggregation->setField($field);

        $aggregation->setScript($script);

        $aggregation->setPrecisionThreshold($precision);

        $aggregation->setRehash($rehash);

        $this->append($aggregation);
    }
public function cardinality ( $ alias , $ field = null , $ script = null , $ precision = null , $ rehash = null ) { $ aggregation = new CardinalityAggregation ( $ alias ) ; $ aggregation -> setField ( $ field ) ; $ aggregation -> setScript ( $ script ) ; $ aggregation -> setPrecisionThreshold ( $ precision ) ; $ aggregation -> setRehash ( $ rehash ) ; $ this -> append ( $ aggregation ) ; }
Add an cardinality aggregate.

@param $alias
@param string|null $field
@param string|null $script
@param int         $precision
@param bool        $rehash
Add an cardinality aggregate .