Skip to content

Commit 74aff7a

Browse files
authored
Merge pull request #103 from ensi-platform/v7-ecs-1350-2
ECS-1350 fix size SearchQuery
2 parents 3446155 + 6c6b8f3 commit 74aff7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Search/SearchQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function get(): Collection
6262

6363
public function paginate(int $size, int $offset = 0, ?callable $async = null): Page|FutureArray
6464
{
65-
Assert::greaterThan($size, 0);
65+
Assert::greaterThanEq($size, 0);
6666
Assert::greaterThanEq($offset, 0);
6767

6868
if ($async) {
@@ -94,7 +94,7 @@ protected function responseToPage(int $size, int $offset, array $response): Page
9494

9595
public function cursorPaginate(int $size, ?string $cursor = null): CursorPage
9696
{
97-
Assert::greaterThan($size, 0);
97+
Assert::greaterThanEq($size, 0);
9898

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

183-
$dsl = array_filter($dsl);
183+
$dsl = array_filter($dsl, fn (mixed $v) => !is_null($v));
184184

185185
return $async ? $this->index->searchAsync($dsl, $this->searchType) : $this->index->search($dsl, $this->searchType);
186186
}

0 commit comments

Comments
 (0)