@@ -6126,6 +6126,10 @@ public GetApiKeyResponse waitForApiKey(String key, ApiKeyOperation operation) {
6126
6126
public <T > Iterable <T > browseObjects (String indexName , BrowseParamsObject params , Class <T > innerType , RequestOptions requestOptions ) {
6127
6127
final Holder <String > currentCursor = new Holder <>();
6128
6128
6129
+ if (params .getHitsPerPage () == null ) {
6130
+ params .setHitsPerPage (1000 );
6131
+ }
6132
+
6129
6133
return AlgoliaIterableHelper .createIterable (
6130
6134
() -> {
6131
6135
BrowseResponse <T > response = this .browse (indexName , params , innerType , requestOptions );
@@ -6175,7 +6179,7 @@ public Iterable<SynonymHit> browseSynonyms(String indexName, SearchSynonymsParam
6175
6179
return AlgoliaIterableHelper .createIterable (
6176
6180
() -> {
6177
6181
SearchSynonymsResponse response = this .searchSynonyms (indexName , params , requestOptions );
6178
- currentPage .value = response .getNbHits () < params .getHitsPerPage () ? null : currentPage .value + 1 ;
6182
+ currentPage .value = response .getHits (). size () < params .getHitsPerPage () ? null : currentPage .value + 1 ;
6179
6183
return response .getHits ().iterator ();
6180
6184
},
6181
6185
() -> currentPage .value != null
@@ -6217,7 +6221,7 @@ public Iterable<Rule> browseRules(String indexName, SearchRulesParams params, Re
6217
6221
return AlgoliaIterableHelper .createIterable (
6218
6222
() -> {
6219
6223
SearchRulesResponse response = this .searchRules (indexName , params .setPage (currentPage .value ), requestOptions );
6220
- currentPage .value = response .getNbHits () < hitsPerPage ? null : currentPage .value + 1 ;
6224
+ currentPage .value = response .getHits (). size () < hitsPerPage ? null : currentPage .value + 1 ;
6221
6225
return response .getHits ().iterator ();
6222
6226
},
6223
6227
() -> currentPage .value != null
0 commit comments