From 8107d92014db19e8a228d3e6df8204c445913592 Mon Sep 17 00:00:00 2001 From: MarkLark86 Date: Mon, 26 Aug 2024 15:04:17 +1000 Subject: [PATCH] [TGA-107] fix: Apply AuthorProfile schema changes to archived, published and content api (#67) --- server/settings.py | 67 +++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/server/settings.py b/server/settings.py index 273d924..2fb3f0b 100644 --- a/server/settings.py +++ b/server/settings.py @@ -214,40 +214,45 @@ }, } -SCHEMA_UPDATE = { - "archive": { - "extra": { - "type": "dict", - "schema": {}, - "mapping": { - "type": "object", - "dynamic": False, - "properties": { - "profile_id": not_analyzed, - "profile_first_name": es_text, - "profile_last_name": es_text, - "profile_title": cv_item, - "profile_job_title": cv_item, - "profile_email": es_text, - "profile_university": cv_item, - "profile_project": cv_item, - "profile_country": { - "type": "object", - "properties": { - "name": text_with_keyword, - "qcode": not_analyzed, - "region": text_with_keyword, - }, +extra_schema = { + "extra": { + "type": "dict", + "schema": {}, + "mapping": { + "type": "object", + "dynamic": False, + "properties": { + "profile_id": not_analyzed, + "profile_first_name": es_text, + "profile_last_name": es_text, + "profile_title": cv_item, + "profile_job_title": cv_item, + "profile_email": es_text, + "profile_university": cv_item, + "profile_project": cv_item, + "profile_country": { + "type": "object", + "properties": { + "name": text_with_keyword, + "qcode": not_analyzed, + "region": text_with_keyword, }, - "profile_biography": string_with_analyzer, - "profile_gender": cv_item, - "profile_age_group": cv_item, - "profile_orcid_id": es_text, - "profile_sdg": cv_item, - "profile_sdgs": cv_item, }, + "profile_biography": string_with_analyzer, + "profile_gender": cv_item, + "profile_age_group": cv_item, + "profile_orcid_id": es_text, + "profile_sdg": cv_item, + "profile_sdgs": cv_item, }, - "allow_unknown": True, }, + "allow_unknown": True, }, } + +SCHEMA_UPDATE = { + "archive": extra_schema, + "archived": extra_schema, + "published": extra_schema, + "items": extra_schema, # ContentAPI +}