Skip to content

Commit bf2ffff

Browse files
authored
Merge pull request #102 from ensi-platform/v8-ecs-1350-2
ECS-1350 fix size SearchQuery
2 parents 78c0c6f + 78e81ad commit bf2ffff

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
@@ -66,7 +66,7 @@ function (array $response) {
6666

6767
public function paginate(int $size, int $offset = 0): Page|Promise
6868
{
69-
Assert::greaterThan($size, 0);
69+
Assert::greaterThanEq($size, 0);
7070
Assert::greaterThanEq($offset, 0);
7171

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

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

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

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

186186
protected function sourceToDSL(bool $source): array | bool

0 commit comments

Comments
 (0)