diff --git a/api/src/adapters/search/opensearch_client.py b/api/src/adapters/search/opensearch_client.py index f6a5f381c..b3636ccc3 100644 --- a/api/src/adapters/search/opensearch_client.py +++ b/api/src/adapters/search/opensearch_client.py @@ -216,11 +216,14 @@ def search( search_query: dict, include_scores: bool = True, params: dict | None = None, + excludes: list[str] | None = None, ) -> SearchResponse: if params is None: params = {} - response = self._client.search(index=index_name, body=search_query, params=params) + response = self._client.search( + index=index_name, body=search_query, params=params, _source_excludes=excludes + ) return SearchResponse.from_opensearch_response(response, include_scores) def scroll( diff --git a/api/src/services/opportunities_v1/search_opportunities.py b/api/src/services/opportunities_v1/search_opportunities.py index 70ae5c2e9..664fac423 100644 --- a/api/src/services/opportunities_v1/search_opportunities.py +++ b/api/src/services/opportunities_v1/search_opportunities.py @@ -180,7 +180,7 @@ def search_opportunities( "Querying search index alias %s", index_alias, extra={"search_index_alias": index_alias} ) - response = search_client.search(index_alias, search_request) + response = search_client.search(index_alias, search_request, excludes=["attachments"]) pagination_info = PaginationInfo( page_offset=search_params.pagination.page_offset,