Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Search/SearchQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function (array $response) {

public function paginate(int $size, int $offset = 0): Page|Promise
{
Assert::greaterThan($size, 0);
Assert::greaterThanEq($size, 0);
Assert::greaterThanEq($offset, 0);

return Response::fn(
Expand All @@ -87,7 +87,7 @@ function (array $response) use ($size, $offset) {

public function cursorPaginate(int $size, ?string $cursor = null): CursorPage|Promise
{
Assert::greaterThan($size, 0);
Assert::greaterThanEq($size, 0);

$sorts = $this->sorts->withTiebreaker($this->index->tiebreaker());
$current = Cursor::decode($cursor) ?? Cursor::BOF();
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function execute(
$dsl['search_after'] = $cursor->toDSL();
}

return $this->index->search(array_filter($dsl), $this->searchType);
return $this->index->search(array_filter($dsl, fn (mixed $v) => !is_null($v)), $this->searchType);
}

protected function sourceToDSL(bool $source): array | bool
Expand Down
Loading