@@ -6126,6 +6126,10 @@ public GetApiKeyResponse waitForApiKey(String key, ApiKeyOperation operation) {
61266126 public <T > Iterable <T > browseObjects (String indexName , BrowseParamsObject params , Class <T > innerType , RequestOptions requestOptions ) {
61276127 final Holder <String > currentCursor = new Holder <>();
61286128
6129+ if (params .getHitsPerPage () == null ) {
6130+ params .setHitsPerPage (1000 );
6131+ }
6132+
61296133 return AlgoliaIterableHelper .createIterable (
61306134 () -> {
61316135 BrowseResponse <T > response = this .browse (indexName , params , innerType , requestOptions );
@@ -6175,7 +6179,7 @@ public Iterable<SynonymHit> browseSynonyms(String indexName, SearchSynonymsParam
61756179 return AlgoliaIterableHelper .createIterable (
61766180 () -> {
61776181 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 ;
61796183 return response .getHits ().iterator ();
61806184 },
61816185 () -> currentPage .value != null
@@ -6217,7 +6221,7 @@ public Iterable<Rule> browseRules(String indexName, SearchRulesParams params, Re
62176221 return AlgoliaIterableHelper .createIterable (
62186222 () -> {
62196223 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 ;
62216225 return response .getHits ().iterator ();
62226226 },
62236227 () -> currentPage .value != null
0 commit comments