fix dataset_id and index_node_id idx missed in document_segments tabl… (#7681)

This commit is contained in:
Jyong 2024-08-27 10:25:24 +08:00 committed by GitHub
parent 7b7576ad55
commit 35431bce0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -720,6 +720,7 @@ class IndexingRunner:
document_ids = [document.metadata['doc_id'] for document in documents]
db.session.query(DocumentSegment).filter(
DocumentSegment.document_id == document_id,
DocumentSegment.dataset_id == dataset_id,
DocumentSegment.index_node_id.in_(document_ids),
DocumentSegment.status == "indexing"
).update({
@ -751,6 +752,7 @@ class IndexingRunner:
document_ids = [document.metadata['doc_id'] for document in chunk_documents]
db.session.query(DocumentSegment).filter(
DocumentSegment.document_id == dataset_document.id,
DocumentSegment.dataset_id == dataset.id,
DocumentSegment.index_node_id.in_(document_ids),
DocumentSegment.status == "indexing"
).update({