For example, the UI can adapt following approach:
- Get and display the accurate count of the number of total hits (SearchResult.getTotalMatches() or total in the querybuilder.json response) are less than or equal to 100;
- Set guessTotal to 100 while making the call to the Query Builder.
- The response can have the following outcome:
- total=43, more=false - Indicates that total number of hits is 43. The UI can show up to ten results as part of the first page and provide pagination for the next three pages. You can also use this implementation to display a descriptive text like "43 results found".
- total=100, more=true - Indicates that the total number of hits is greater than 100 and the exact count is not known. The UI can show up to ten as part of the first page and provide pagination for the next ten pages. You can also use this to display a text like "more than 100 results found". As the user goes to the next pages calls made to the Query Builder would increase the limit of guessTotal and also of the offset and limitparameters.
https://docs.adobe.com/content/docs/en/aem/6-0/develop/search/querybuilder-api.html