From 5090c802154120265c47070ac2ae6faf8a47cf38 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Mon, 9 Dec 2024 12:20:11 +0100 Subject: [PATCH] community-records: allow scan search * Adds `scan` and `scan_params` arguments to `CommunityRecordsService.search(...)`, to allow for serving scan results (but only via the service). --- .../services/community_records/service.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/invenio_rdm_records/services/community_records/service.py b/invenio_rdm_records/services/community_records/service.py index 8ed6c4c85..c2c7fb8fc 100644 --- a/invenio_rdm_records/services/community_records/service.py +++ b/invenio_rdm_records/services/community_records/service.py @@ -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.""" @@ -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,