diff --git a/service/src/main/inse/projects/eu_cordis_projects_client.py b/service/src/main/inse/projects/eu_cordis_projects_client.py index 33c5418d..f2a6dcad 100644 --- a/service/src/main/inse/projects/eu_cordis_projects_client.py +++ b/service/src/main/inse/projects/eu_cordis_projects_client.py @@ -502,9 +502,9 @@ def _eu_year_filters(field: str, years: list[str]) -> dict[str, Any]: def _eu_sort_field(sort_by: str) -> str: mapping = { "title": "title.keyword", - "funding_start": "startDate", - "funding_end": "endDate", - "funding_amount": "ecMaxContribution", + "startDate": "startDate", + "endDate": "endDate", + "ecMaxContribution": "ecMaxContribution", "id": "id", "project_type": "_index", } @@ -998,7 +998,7 @@ async def search_eu_cordis_projects( if sort_direction not in ["asc", "desc"]: sort_direction = "asc" - sort_field = _eu_sort_field(sort_by.strip().lower()) + sort_field = _eu_sort_field(sort_by) response = await elasticsearch.search( index=indices, cluster=ESCluster.INSE,