Skip to content

Commit e771ca3

Browse files
authored
Merge pull request #14 from olekjs/1.10.0
1.11.0
2 parents 9151647 + f99d401 commit e771ca3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/Builder/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ public function getNested(): array
448448

449449
public function performSearchBody(): void
450450
{
451+
if (isset($this->sort)) {
452+
$this->body['sort'] = $this->sort;
453+
}
454+
451455
if (isset($this->nested)) {
452456
foreach ($this->nested as $nested) {
453457
$this->body['query']['bool']['must'][] = $nested;

src/Client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public function count(string $index, array $data = []): int
283283
unset($data['aggs']);
284284
}
285285

286+
if (isset($data['sort'])) {
287+
unset($data['sort']);
288+
}
289+
286290
if (empty($data)) {
287291
$data = [
288292
'query' => [

src/Dto/SearchHitDto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SearchHitDto implements ResponseDtoInterface, Arrayable
1010
public function __construct(
1111
private readonly string $index,
1212
private readonly string $id,
13-
private readonly float $score,
13+
private readonly ?float $score,
1414
private readonly array $source,
1515
) {
1616
}
@@ -25,7 +25,7 @@ public function getId(): string
2525
return $this->id;
2626
}
2727

28-
public function getScore(): float
28+
public function getScore(): ?float
2929
{
3030
return $this->score;
3131
}

0 commit comments

Comments
 (0)