|
7 | 7 | * @since Mar 2023 |
8 | 8 | * @author Haydar KULEKCI <haydarkulekci@gmail.com> |
9 | 9 | */ |
| 10 | + |
10 | 11 | namespace Qdrant\Endpoints\Collections; |
11 | 12 |
|
12 | 13 | use Qdrant\Endpoints\AbstractEndpoint; |
|
16 | 17 | use Qdrant\Models\PointsStruct; |
17 | 18 | use Qdrant\Models\Request\PointsBatch; |
18 | 19 | use Qdrant\Models\Request\RecommendRequest; |
| 20 | +use Qdrant\Models\Request\ScrollRequest; |
19 | 21 | use Qdrant\Models\Request\SearchRequest; |
20 | 22 | use Qdrant\Response; |
21 | 23 |
|
@@ -43,19 +45,18 @@ public function search(SearchRequest $searchParams): Response |
43 | 45 | /** |
44 | 46 | * @throws InvalidArgumentException |
45 | 47 | */ |
46 | | - public function scroll(Filter $filter = null, int $limit = null): Response |
| 48 | + public function scroll(Filter|ScrollRequest $scrollParams = null, array $queryParams = []): Response |
47 | 49 | { |
48 | 50 | $body = []; |
49 | | - if ($filter) { |
50 | | - $body['filter'] = $filter->toArray(); |
51 | | - } |
52 | | - if ($limit) { |
53 | | - $body['limit'] = $limit; |
| 51 | + if ($scrollParams instanceof Filter) { |
| 52 | + $body['filter'] = $scrollParams->toArray(); |
| 53 | + } elseif ($scrollParams instanceof ScrollRequest) { |
| 54 | + $body = $scrollParams->toArray(); |
54 | 55 | } |
55 | 56 | return $this->client->execute( |
56 | 57 | $this->createRequest( |
57 | 58 | 'POST', |
58 | | - '/collections/' . $this->getCollectionName() . '/points/scroll', |
| 59 | + '/collections/' . $this->getCollectionName() . '/points/scroll' . $this->queryBuild($queryParams), |
59 | 60 | $body |
60 | 61 | ) |
61 | 62 | ); |
@@ -103,9 +104,9 @@ public function ids(array $ids, $withPayload = false, $withVector = true, array |
103 | 104 | 'POST', |
104 | 105 | '/collections/' . $this->getCollectionName() . '/points' . $this->queryBuild($queryParams), |
105 | 106 | [ |
106 | | - 'ids' => $ids, |
| 107 | + 'ids' => $ids, |
107 | 108 | 'with_payload' => $withPayload, |
108 | | - 'with_vector' => $withVector, |
| 109 | + 'with_vector' => $withVector, |
109 | 110 | ] |
110 | 111 | ) |
111 | 112 | ); |
|
0 commit comments