Skip to content

Commit

Permalink
fix: also add "names" field from taxonomy during indexation
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Nov 9, 2023
1 parent 0697c56 commit eea5726
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/cli/perform_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit eea5726

Please sign in to comment.