fixed eu filtering bug #308
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user