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);
}