From ac88c926ab1e8350d3764282e5570d9f20d0c462 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Tue, 17 Dec 2024 16:04:55 +0100 Subject: [PATCH] avoid extra fields mapped in elastic trying to explicitly avoid those fields, they still get auto created. --- server/planning/events/events_schema.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server/planning/events/events_schema.py b/server/planning/events/events_schema.py index 15b028232..d3b5bf9e3 100644 --- a/server/planning/events/events_schema.py +++ b/server/planning/events/events_schema.py @@ -78,7 +78,20 @@ "accreditation_deadline": {"type": "datetime"}, # Reference can be used to hold for example a court case reference number "reference": {"type": "string"}, - "anpa_category": metadata_schema["anpa_category"], + "anpa_category": { + "type": "list", + "nullable": True, + "mapping": { + "type": "object", + "dynamic": False, + "properties": { + "qcode": not_analyzed, + "name": not_analyzed, + "scheme": not_analyzed, + "translations": {"enabled": False}, # explicitly disable + }, + }, + }, "files": { "type": "list", "nullable": True, @@ -209,6 +222,7 @@ "address": {"type": "object", "dynamic": True}, "geo": {"type": "string"}, "location": {"type": "geo_point"}, + "translations": {"enabled": False}, # explicitly disable }, }, "nullable": True, @@ -268,6 +282,7 @@ "properties": { "qcode": not_analyzed, "name": not_analyzed, + "translations": {"enabled": False}, # explicitly disable }, }, },