Skip to content

Commit

Permalink
community-records: allow scan search
Browse files Browse the repository at this point in the history
* Adds `scan` and `scan_params` arguments to
  `CommunityRecordsService.search(...)`, to allow for serving scan
  results (but only via the service).
  • Loading branch information
slint committed Dec 9, 2024
1 parent 49a9770 commit 5090c80
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion invenio_rdm_records/services/community_records/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def search(
params=None,
search_preference=None,
extra_filter=None,
scan=False,
scan_params=None,
**kwargs,
):
"""Search for records published in the given community."""
Expand Down Expand Up @@ -76,7 +78,12 @@ def search(
permission_action="read",
**kwargs,
)
search_result = search.execute()

if scan:
scan_params = scan_params or {}
search_result = search.scan(**scan_params)
else:
search_result = search.execute()

return self.result_list(
self,
Expand Down

0 comments on commit 5090c80

Please sign in to comment.