Files
smartguide/service/scripts/projects/topic_mapper/mapping.py
T
arzani e87c62f823
LocationBasedServices/smartguide/pipeline/head This commit looks good
offline crawling scripts for news, bund amd postproc for projects, reworked structure
2026-07-14 16:30:01 +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"},
}
}