From 11c071da33f36200f950155575437b304196257d Mon Sep 17 00:00:00 2001 From: Weves Date: Wed, 16 Aug 2023 12:58:38 -0700 Subject: [PATCH] Fix document display for docs with identical semantic IDs --- web/src/components/search/SearchResultsDisplay.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/web/src/components/search/SearchResultsDisplay.tsx b/web/src/components/search/SearchResultsDisplay.tsx index 30a1ec5f3..1771c8116 100644 --- a/web/src/components/search/SearchResultsDisplay.tsx +++ b/web/src/components/search/SearchResultsDisplay.tsx @@ -14,12 +14,9 @@ const removeDuplicateDocs = (documents: DanswerDocument[]) => { const seen = new Set(); const output: DanswerDocument[] = []; documents.forEach((document) => { - if ( - document.semantic_identifier && - !seen.has(document.semantic_identifier) - ) { + if (document.document_id && !seen.has(document.document_id)) { output.push(document); - seen.add(document.semantic_identifier); + seen.add(document.document_id); } }); return output;