librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.11k stars 202 forks source link

SearchController#index: short-circuit when no search criteria are provided #3212

Closed mpace965 closed 1 year ago

mpace965 commented 1 year ago

Revisit https://github.com/librariesio/libraries.io/pull/3209

This prevents expensive elasticsearch queries that have been the target of scraping efforts. However, this time we only deny a search if no criteria at all is present. e.g. a search without a query is allowed if it has a license filter on it. But a search with only a sort is not allowed.

Screenshot 2023-09-25 at 12 42 52 PM