diff --git a/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts b/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts index 6bff5c8ea..d2113de3f 100644 --- a/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts +++ b/targets/export-elasticsearch/src/ingester/cdtnDocuments.ts @@ -78,20 +78,6 @@ 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("=== Courriers ==="); const modelesDeCourriers = await getDocumentBySource( SOURCES.LETTERS, @@ -390,6 +376,20 @@ 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,