I'm trying to fetch limited amound of search result but still use of pagination. When I use next line in my repository class I get 100 result on the page.
Page<Media> findTop100ByOrderByViewCount(Pageable pageable);
If I use next line instead, then I get expected result with according to my pageable which is 10 item on each page.
Page<Media> findAllByOrderByViewCount(Pageable pageable);
I want to limit the search result. If there are 1000s of search result, I don't want to have 100s of paginated result. I want to limit my paginated limit to have max 10 page.
How can I achieve that in Spring boot? I'm using version of 2.2.2.RELEASE.