fixed DFG index namings

This commit is contained in:
2026-07-20 23:22:11 +02:00
parent b834c1e1d4
commit ee85c99c2f
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -182,7 +182,7 @@ async def get_dashboard_dfg_projects(
normalized_id = _normalize_institution_id(institution_id)
aliases = await _institution_aliases(normalized_id, organization_name)
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_ALL,
index=ESIndex.DFG_PROJECTS,
query=_dfg_institution_query(aliases),
size=0,
track_total_hits=True,
@@ -639,7 +639,7 @@ async def _top_dfg_project_author_buckets(
aliases: list[str],
) -> list[dict[str, Any]]:
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_ALL,
index=ESIndex.DFG_PROJECTS,
body={
"size": 0,
"query": _dfg_institution_query(aliases),
@@ -68,7 +68,7 @@ async def test_dashboard_statistics_counts_organization_data_and_all_projects():
assert [call.kwargs["index"] for call in calls[2:]] == [
ESIndex.CORDIS_EU_ORGANIZATIONS_WILDCARD,
ESIndex.PROJECTS_BUND_V1,
ESIndex.PROJECTS_DFG_ALL,
ESIndex.DFG_PROJECTS,
]
assert calls[2].kwargs["body"]["query"] == {
"terms": {
@@ -131,7 +131,7 @@ async def test_top_authors_maps_works_and_dfg_project_aggregations():
}
}
}
if kwargs["index"] == ESIndex.PROJECTS_DFG_ALL:
if kwargs["index"] == ESIndex.DFG_PROJECTS:
return {
"aggregations": {
"people": {
@@ -181,10 +181,10 @@ async def test_top_authors_maps_works_and_dfg_project_aggregations():
call
for call in mocked_search.await_args_list
if call.kwargs["index"]
in {ESIndex.PROJECTS_DFG_ALL, ESIndex.PROJECTS_BUND_V1}
in {ESIndex.DFG_PROJECTS, ESIndex.PROJECTS_BUND_V1}
]
assert len(project_calls) == 1
assert project_calls[0].kwargs["index"] == ESIndex.PROJECTS_DFG_ALL
assert project_calls[0].kwargs["index"] == ESIndex.DFG_PROJECTS
assert project_calls[0].kwargs["body"]["query"]["bool"][
"minimum_should_match"
] == 1
@@ -198,7 +198,7 @@ async def test_top_authors_keeps_dfg_project_authors_without_openalex_match():
async def search(**kwargs):
if kwargs["index"] == ESIndex.OPENALEX_AUTHORS:
return {"hits": {"hits": []}}
if kwargs["index"] == ESIndex.PROJECTS_DFG_ALL:
if kwargs["index"] == ESIndex.DFG_PROJECTS:
return {
"aggregations": {
"people": {
@@ -232,7 +232,7 @@ async def test_top_authors_returns_top_ten_dfg_project_people_by_project_count()
async def search(**kwargs):
if kwargs["index"] == ESIndex.OPENALEX_AUTHORS:
return {"hits": {"hits": []}}
if kwargs["index"] == ESIndex.PROJECTS_DFG_ALL:
if kwargs["index"] == ESIndex.DFG_PROJECTS:
return {
"aggregations": {
"people": {
@@ -280,7 +280,7 @@ async def test_top_authors_combines_dfg_involved_people_case_insensitively():
]
}
}
if kwargs["index"] == ESIndex.PROJECTS_DFG_ALL:
if kwargs["index"] == ESIndex.DFG_PROJECTS:
return {
"aggregations": {
"people": {
@@ -100,7 +100,7 @@ def _index_to_cluster(index: ESIndex) -> Optional[ESCluster]:
ESIndex.CORDIS_EU_PROJECTS_WILDCARD,
ESIndex.CORDIS_EU_PUBLICATIONS_WILDCARD,
ESIndex.PROJECTS_BUND_V1,
ESIndex.PROJECTS_DFG_ALL,
ESIndex.DFG_PROJECTS,
}:
return ESCluster.INSE
else:
@@ -32,7 +32,7 @@ async def search_institutions(
DfgInstitutionSummaryPage: A page of institutions matching the search criteria.
"""
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_INSTITUTES,
index=ESIndex.DFG_INSTITUTES,
cluster=ESCluster.INSE,
query=query,
source=source,
@@ -32,7 +32,7 @@ async def search_persons(
"""
print(query)
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_PERSONS,
index=ESIndex.DFG_PERSONS,
cluster=ESCluster.INSE,
query=query,
source=source,