File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -243,9 +243,13 @@ public extension SearchClient {
243243 aggregator: @escaping ( BrowseResponse < T > ) -> Void ,
244244 requestOptions: RequestOptions ? = nil
245245 ) async throws -> BrowseResponse < T > {
246- try await createIterable (
246+ var updatedBrowseParams = browseParams
247+ if updatedBrowseParams. hitsPerPage == nil {
248+ updatedBrowseParams. hitsPerPage = 1000
249+ }
250+
251+ return try await createIterable (
247252 execute: { previousResponse in
248- var updatedBrowseParams = browseParams
249253 if let previousResponse {
250254 updatedBrowseParams. cursor = previousResponse. cursor
251255 }
@@ -298,7 +302,7 @@ public extension SearchClient {
298302 )
299303 } ,
300304 validate: validate ?? { response in
301- response. nbHits < hitsPerPage
305+ response. hits . count < hitsPerPage
302306 } ,
303307 aggregator: aggregator
304308 )
@@ -341,7 +345,7 @@ public extension SearchClient {
341345 )
342346 } ,
343347 validate: validate ?? { response in
344- response. nbHits < hitsPerPage
348+ response. hits . count < hitsPerPage
345349 } ,
346350 aggregator: aggregator
347351 )
You can’t perform that action at this time.
0 commit comments