From cd4999fc2867b45b583a69e099ea2e247536d8a4 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Wed, 15 Jan 2025 17:20:51 +0100 Subject: [PATCH] fix: use versioned index name instead of alias to get mappings --- backend/es/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/es/views.py b/backend/es/views.py index 06d5409bf..295d93895 100644 --- a/backend/es/views.py +++ b/backend/es/views.py @@ -135,7 +135,8 @@ def get(self, request, *args, **kwargs): def find_named_entity_fields(self, client, index: str) -> list[str]: mapping = client.indices.get_mapping(index=index) - fields = mapping[index]['mappings']['properties'] + index_name = list(mapping.keys())[0] + fields = mapping[index_name]['mappings']['properties'] field_names = fields.keys() return [name for name in field_names if name.endswith(':ner')]