| 1 | <?php |
||
| 10 | class GeotileGridAggregation extends AbstractAggregation |
||
| 11 | { |
||
| 12 | use Traits\ShardSizeTrait; |
||
| 13 | |||
| 14 | public const DEFAULT_PRECISION_VALUE = 7; |
||
| 15 | public const DEFAULT_SIZE_VALUE = 10000; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string $name the name of this aggregation |
||
| 19 | * @param string $field the field on which to perform this aggregation |
||
| 20 | */ |
||
| 21 | public function __construct(string $name, string $field) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Set the field for this aggregation. |
||
| 29 | * |
||
| 30 | * @param string $field the name of the document field on which to perform this aggregation |
||
| 31 | * |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | public function setField(string $field): self |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Set the precision for this aggregation. |
||
| 41 | * |
||
| 42 | * @param int $precision an integer between 1 and 12, inclusive. Defaults to 5. |
||
| 43 | * |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | public function setPrecision(int $precision): self |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set the maximum number of buckets to return. |
||
| 53 | * |
||
| 54 | * @param int $size defaults to 10,000 |
||
| 55 | * |
||
| 56 | * @return $this |
||
| 57 | */ |
||
| 58 | public function setSize(int $size): self |
||
| 62 | } |
||
| 63 |