We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2214fd1 commit 8925747Copy full SHA for 8925747
src/Aggregation/Max.php
@@ -0,0 +1,37 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Spameri\ElasticQuery\Aggregation;
4
5
+class Max implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
6
+{
7
8
+ private string $field;
9
10
11
+ public function __construct(
12
+ string $field
13
+ )
14
+ {
15
+ $this->field = $field;
16
+ }
17
18
19
+ public function key(): string
20
21
+ return 'max_' . $this->field;
22
23
24
25
+ /**
26
+ * @return array<string, array<string, string>>
27
+ */
28
+ public function toArray(): array
29
30
+ return [
31
+ 'max' => [
32
+ 'field' => $this->field,
33
+ ],
34
+ ];
35
36
37
+}
0 commit comments