Skip to content

Commit 8783c4c

Browse files
fix(python): add warning in replace_all_objects for empty objects (generated)
algolia/api-clients-automation#6611 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com>
1 parent 65afb8d commit 8783c4c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

algoliasearch/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12781,14 +12781,13 @@ public <T> Iterable<T> browseObjects(String indexName, Class<T> innerType) {
1278112781
*/
1278212782
public Iterable<SynonymHit> browseSynonyms(String indexName, SearchSynonymsParams params, RequestOptions requestOptions) {
1278312783
final Holder<Integer> currentPage = new Holder<>(0);
12784-
12785-
params.setPage(0);
12786-
params.setHitsPerPage(1000);
12784+
final int hitsPerPage = 1000;
12785+
params.setHitsPerPage(hitsPerPage);
1278712786

1278812787
return AlgoliaIterableHelper.createIterable(
1278912788
() -> {
12790-
SearchSynonymsResponse response = this.searchSynonyms(indexName, params, requestOptions);
12791-
currentPage.value = response.getHits().size() < params.getHitsPerPage() ? null : currentPage.value + 1;
12789+
SearchSynonymsResponse response = this.searchSynonyms(indexName, params.setPage(currentPage.value), requestOptions);
12790+
currentPage.value = response.getHits().size() < hitsPerPage ? null : currentPage.value + 1;
1279212791
return response.getHits().iterator();
1279312792
},
1279412793
() -> currentPage.value != null
@@ -12811,7 +12810,7 @@ public Iterable<SynonymHit> browseSynonyms(String indexName, SearchSynonymsParam
1281112810
* @param indexName The index in which to perform the request.
1281212811
*/
1281312812
public Iterable<SynonymHit> browseSynonyms(String indexName) {
12814-
return browseSynonyms(indexName, null, null);
12813+
return browseSynonyms(indexName, new SearchSynonymsParams(), null);
1281512814
}
1281612815

1281712816
/**

0 commit comments

Comments
 (0)