Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions SearchAPI/SearchQuery.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def can_use_cmr(self):

def check_has_search_params(self):
non_searchable_param = ['output', 'maxresults', 'pagesize', 'maturity']
list_param_exceptions = ['collections']
list_param_exceptions = ['collections'] # allows collections in granule/product search

params = [v.lower() for v in self.request.local_values]
is_collection_search = 'collections' in params

searchables = [
v for v in self.request.local_values if v.lower() not in [*non_searchable_param, *list_param_exceptions]
v for v in params if v not in [*non_searchable_param, *list_param_exceptions]
]

if len(searchables) <= 0:
if len(searchables) <= 0 and not is_collection_search:
raise ValueError(
'No searchable parameters specified, queries must include'
' parameters besides output= and maxresults='
Expand Down