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