From ea59ca65d6a07abceb5aca876ca35d7537137615 Mon Sep 17 00:00:00 2001 From: Martial Maillot Date: Wed, 3 Apr 2024 10:47:47 +0200 Subject: [PATCH] fix(export): replace editorial content --- .../src/ingester/cdtnDocuments.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts b/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts index e666ed963..9f5b5f2b9 100644 --- a/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts +++ b/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts @@ -78,6 +78,20 @@ export async function cdtnDocumentsGen( ); }; + logger.info("=== Editorial contents ==="); + const documents = await getDocumentBySource( + SOURCES.EDITORIAL_CONTENT, + getBreadcrumbs + ); + const { + documents: editorialContents, + relatedIdsDocuments: relatedIdsEditorialDocuments, + } = await generateEditorialContents(documents, addGlossary); + documentsCount = { + ...documentsCount, + [SOURCES.EDITORIAL_CONTENT]: editorialContents.length, + }; + logger.info("=== Outils ==="); const tools = await getDocumentBySource(SOURCES.TOOLS, getBreadcrumbs); documentsCount = { @@ -376,20 +390,6 @@ export async function cdtnDocumentsGen( }; await updateDocs(SOURCES.CDT, cdtDoc); - logger.info("=== Editorial contents ==="); - const documents = await getDocumentBySource( - SOURCES.EDITORIAL_CONTENT, - getBreadcrumbs - ); - const { - documents: editorialContents, - relatedIdsDocuments: relatedIdsEditorialDocuments, - } = await generateEditorialContents(documents, addGlossary); - documentsCount = { - ...documentsCount, - [SOURCES.EDITORIAL_CONTENT]: editorialContents.length, - }; - logger.info("=== Merge Related Documents ==="); const allDocuments = [ ...editorialContents,