setField($field); } /** * Set the field for this aggregation. * * @param string $field the name of the document field on which to perform this aggregation * * @return $this */ public function setField(string $field): self { return $this->setParam('field', $field); } /** * Set the precision for this aggregation. * * @param int $precision an integer between 1 and 12, inclusive. Defaults to 5. * * @return $this */ public function setPrecision(int $precision): self { return $this->setParam('precision', $precision); } /** * Set the maximum number of buckets to return. * * @param int $size defaults to 10,000 * * @return $this */ public function setSize(int $size): self { return $this->setParam('size', $size); } }