I always retrieve the same records

Hi, Community. I have an index with 74 records. This my code:

        SearchResult<MyClass> searchResults = index.search(new Query(""));
        List<myClass> algoliaProducts = new ArrayList<>();
        for (int i = 0; i < searchResults.getNbPages(); i++) {
            algoliaProducts.addAll(searchResults.setPage(i).getHits());
        }

My question is why I always retrieve the same 20 records if I set the page number after to get the hits.

Thank you very much

Hi @aroldan could you provide the API client and version you are using?

This the dependency I’m using:

<dependency>
      <groupId>com.algolia</groupId>
      <artifactId>algoliasearch-apache</artifactId>
      <version>3.10.0</version>
 </dependency>