mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-10 13:15:18 +02:00
Fix document display for docs with identical semantic IDs
This commit is contained in:
@@ -14,12 +14,9 @@ const removeDuplicateDocs = (documents: DanswerDocument[]) => {
|
|||||||
const seen = new Set<string>();
|
const seen = new Set<string>();
|
||||||
const output: DanswerDocument[] = [];
|
const output: DanswerDocument[] = [];
|
||||||
documents.forEach((document) => {
|
documents.forEach((document) => {
|
||||||
if (
|
if (document.document_id && !seen.has(document.document_id)) {
|
||||||
document.semantic_identifier &&
|
|
||||||
!seen.has(document.semantic_identifier)
|
|
||||||
) {
|
|
||||||
output.push(document);
|
output.push(document);
|
||||||
seen.add(document.semantic_identifier);
|
seen.add(document.document_id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return output;
|
return output;
|
||||||
|
Reference in New Issue
Block a user