added all new indicies, changed dfg models and query

This commit is contained in:
Kazgatari
2026-07-17 20:33:41 +02:00
parent 5c0f6929bf
commit ff370d49c8
3 changed files with 45 additions and 1 deletions
+12
View File
@@ -103,3 +103,15 @@ class ESIndex(StrEnum):
CORDIS_EU_HORIZON_EUROPE_LEGAL_BASIS = "cordis_eu_horizon_europe_legal_basis"
WORK_CLASSIFICATIONS = "work-classifications"
DFG_INSTITUTES = "dfg_institutes_2.0"
DFG_PERSONS = "dfg_persons_2.0"
DFG_PROJECTS = "dfg_projects_2.0"
PROJECTS_BUND_TOPICS = "projects_bund_openalex_topics"
PROJECTS_DFG_TOPICS = "projects_dfg_openalex_topics"
PROJECTS_CORDIS_EU_FP7_TOPICS_MAPPING = "projects_cordiseu_fp7_openalex_topics"
PROJECTS_CORDIS_EU_H2020_TOPICS = "projects_cordiseu_h2020_openalex_topics"
PROJECTS_CORDIS_EU_HEUROPE_TOPICS = "projects_cordiseu_heurope_openalex_topics"
PATENTS_OPENALEX_KEYWORDS = "patents_openalex_keywords"
+3 -1
View File
@@ -221,6 +221,8 @@ class FundingProject(BaseModel):
@field_validator("start_date", "end_date", mode="before")
@classmethod
def parse_all_date_formats(cls, value):
if isinstance(value, int):
value = str(value)
if isinstance(value, str):
value = value.strip()
@@ -281,7 +283,7 @@ class FundingProject(BaseModel):
return cls(
type=ProjectType.DFG,
id=hit.get("_id", ""),
title=source.get("title"),
title=source.get("title_de") or source.get("title_en"),
start_date=source.get("funding_start"),
end_date=source.get("funding_end"),
acronym=source.get("acronym"),
@@ -790,6 +790,20 @@ async def search_all_projects(
"unmapped_type": "keyword",
}
},
{
"title_de.keyword": {
"order": sort_direction,
"missing": "_last",
"unmapped_type": "keyword",
}
},
{
"title_en.keyword": {
"order": sort_direction,
"missing": "_last",
"unmapped_type": "keyword",
}
},
{
"Thema.keyword": {
"order": sort_direction,
@@ -818,6 +832,22 @@ async def search_all_projects(
}
}
},
{
"wildcard": {
"title_de.keyword": {
"value": wildcard_title,
"case_insensitive": True,
}
}
},
{
"wildcard": {
"title_en.keyword": {
"value": wildcard_title,
"case_insensitive": True,
}
}
},
{
"wildcard": {
"Thema.keyword": {