Skip to content

Commit

Permalink
Merge pull request #14 from olekjs/1.10.0
Browse files Browse the repository at this point in the history
1.11.0
  • Loading branch information
olekjs authored Sep 11, 2023
2 parents 9151647 + f99d401 commit e771ca3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Builder/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ public function getNested(): array

public function performSearchBody(): void
{
if (isset($this->sort)) {
$this->body['sort'] = $this->sort;
}

if (isset($this->nested)) {
foreach ($this->nested as $nested) {
$this->body['query']['bool']['must'][] = $nested;
Expand Down
4 changes: 4 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ public function count(string $index, array $data = []): int
unset($data['aggs']);
}

if (isset($data['sort'])) {
unset($data['sort']);
}

if (empty($data)) {
$data = [
'query' => [
Expand Down
4 changes: 2 additions & 2 deletions src/Dto/SearchHitDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SearchHitDto implements ResponseDtoInterface, Arrayable
public function __construct(
private readonly string $index,
private readonly string $id,
private readonly float $score,
private readonly ?float $score,
private readonly array $source,
) {
}
Expand All @@ -25,7 +25,7 @@ public function getId(): string
return $this->id;
}

public function getScore(): float
public function getScore(): ?float
{
return $this->score;
}
Expand Down

0 comments on commit e771ca3

Please sign in to comment.