From eea5726e9f62a1baa85dec9d781f0e3f20c7d8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Thu, 9 Nov 2023 16:39:54 +0100 Subject: [PATCH] fix: also add "names" field from taxonomy during indexation --- app/cli/perform_import.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/cli/perform_import.py b/app/cli/perform_import.py index 5ee1faf3..a3445b3d 100644 --- a/app/cli/perform_import.py +++ b/app/cli/perform_import.py @@ -83,11 +83,15 @@ def gen_taxonomy_documents( taxonomy_source_config.name, str(taxonomy_source_config.url) ) for node in taxonomy.iter_nodes(): - names = { - lang: lang_names - for lang, lang_names in node.synonyms.items() - if lang in supported_langs - } + names = {} + for lang in supported_langs: + lang_names = set() + if lang in node.names: + lang_names.add(node.names[lang]) + if lang in node.synonyms: + lang_names |= set(node.synonyms[lang]) + names[lang] = list(lang_names) + yield { "_index": next_index, "_source": {