mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-29 11:12:02 +01:00
Fix document display for docs with identical semantic IDs
This commit is contained in:
parent
0aa04ad616
commit
11c071da33
@ -14,12 +14,9 @@ const removeDuplicateDocs = (documents: DanswerDocument[]) => {
|
||||
const seen = new Set<string>();
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user