Files
smartguide/service/scripts/projects/mapping.py
T
arzani 54696df912
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
LocationBasedServices/smartguide/pipeline/head This commit looks good
job for matching projects to openalex topics, can be used for bund, eu and eventually dfg
2026-07-13 22:11:41 +02:00

31 lines
1.1 KiB
Python

"""Elasticsearch mapping for project -> OpenAlex topic mapping indices.
One document per (project, keyword) pair. For sources where the keyword field
is unique per project (e.g. projects_bund_v1 Leistungsplansystematik_fullname)
this means one document per project.
"""
PROJECT_TOPICS_MAPPING = {
"properties": {
"project_id": {"type": "keyword"},
"keyword": {"type": "text", "fields": {"keyword": {"type": "keyword"}}},
"source_index": {"type": "keyword"},
"source_field": {"type": "keyword"},
"topic_matches": {
"type": "nested",
"properties": {
"rank": {"type": "integer"},
"topic_id": {"type": "keyword"},
"topic_display_name": {"type": "keyword"},
"subfield": {"type": "keyword"},
"field": {"type": "keyword"},
"domain": {"type": "keyword"},
"match_score": {"type": "float"},
},
},
"match_method": {"type": "keyword"},
"model_name": {"type": "keyword"},
"built_at": {"type": "date"},
}
}