fixed eu filtering bug #308

Merged
genja merged 1 commits from feature/keywords-analysis into dev 2026-08-29 16:04:46 +02:00
@@ -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,