Skip to content

Commit

Permalink
fix(export): replace editorial content
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot committed Apr 3, 2024
1 parent 35014ee commit ea59ca6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions targets/export-elasticsearch/src/ingester/cdtnDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ export async function cdtnDocumentsGen(
);
};

logger.info("=== Editorial contents ===");
const documents = await getDocumentBySource<EditorialContentDoc>(
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 = {
Expand Down Expand Up @@ -376,20 +390,6 @@ export async function cdtnDocumentsGen(
};
await updateDocs(SOURCES.CDT, cdtDoc);

logger.info("=== Editorial contents ===");
const documents = await getDocumentBySource<EditorialContentDoc>(
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,
Expand Down

0 comments on commit ea59ca6

Please sign in to comment.