Skip to content

Commit fb3d14e

Browse files
authored
Update InnerHits add array sorts
1 parent 9a53450 commit fb3d14e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Search/Collapsing/InnerHits.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public function __construct(
1212
protected string $name,
1313
protected int $size,
1414
protected ?Sort $sort,
15+
protected array $sorts = [],
1516
) {
1617
Assert::stringNotEmpty(trim($name));
1718
}
@@ -27,6 +28,13 @@ public function toDSL(): array
2728
$dsl['sort'] = $this->sort->toDSL();
2829
}
2930

31+
if ($this->sorts) {
32+
$dsl['sort'] = [];
33+
foreach ($this->sorts as $sort) {
34+
$dsl['sort'][] = $sort->toDSL();
35+
}
36+
}
37+
3038
return $dsl;
3139
}
3240
}

0 commit comments

Comments
 (0)