1 | <?php |
||
10 | class Histogram extends AbstractSimpleAggregation |
||
11 | { |
||
12 | /** |
||
13 | * @param string $name the name of this aggregation |
||
14 | * @param string $field the name of the field on which to perform the aggregation |
||
15 | * @param int|string $interval the interval by which documents will be bucketed |
||
16 | */ |
||
17 | public function __construct(string $name, string $field, $interval = null) |
||
28 | |||
29 | /** |
||
30 | * Set the interval by which documents will be bucketed. |
||
31 | * |
||
32 | * @param int|string $interval |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | public function setInterval($interval): self |
||
42 | |||
43 | /** |
||
44 | * Set the fixed interval by which documents will be bucketed. |
||
45 | * |
||
46 | * @param int|string $interval |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function setFixedInterval($interval): self |
||
54 | |||
55 | /** |
||
56 | * Set the calendar interval by which documents will be bucketed. |
||
57 | * |
||
58 | * @param int|string $interval |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setCalendarInterval($interval): self |
||
66 | |||
67 | /** |
||
68 | * Set the bucket sort order. |
||
69 | * |
||
70 | * @param string $order "_count", "_term", or the name of a sub-aggregation or sub-aggregation response field |
||
71 | * @param string $direction "asc" or "desc" |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function setOrder(string $order, string $direction): self |
||
79 | |||
80 | /** |
||
81 | * Set the minimum number of documents which must fall into a bucket in order for the bucket to be returned. |
||
82 | * |
||
83 | * @param int $count set to 0 to include empty buckets |
||
84 | * |
||
85 | * @return $this |
||
86 | */ |
||
87 | public function setMinimumDocumentCount(int $count): self |
||
91 | } |
||
92 |