wiki
wiki copied to clipboard
feat: set search results max hits and fix: total hits displayed instead of max hits
feat: set search results max hits
Added a new field for admins to set the maximum number of results returned from the search engine on the search engine configuration page.

fix: total hits displayed instead of max hits
Problem
Currently, if the total hits are larger than the max hits set in algolia, aws, azure, or elasticsearch search engines, when a user attempts to view pages past the max hits, the empty results page is displayed. For example, if the total hits = 23, and the max hit is set to 20, 3 page icons are generated. However, only pages 1-2 will be viewable, and if the 3rd+ page is clicked on, the empty results page is displayed.

Solution
Display min(results returned size, max hits) instead of total hits.