mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-03 03:38:08 +08:00
fix dataset_id and index_node_id idx missed in document_segments tabl… (#7681)
This commit is contained in:
parent
7b7576ad55
commit
35431bce0d
@ -720,6 +720,7 @@ class IndexingRunner:
|
|||||||
document_ids = [document.metadata['doc_id'] for document in documents]
|
document_ids = [document.metadata['doc_id'] for document in documents]
|
||||||
db.session.query(DocumentSegment).filter(
|
db.session.query(DocumentSegment).filter(
|
||||||
DocumentSegment.document_id == document_id,
|
DocumentSegment.document_id == document_id,
|
||||||
|
DocumentSegment.dataset_id == dataset_id,
|
||||||
DocumentSegment.index_node_id.in_(document_ids),
|
DocumentSegment.index_node_id.in_(document_ids),
|
||||||
DocumentSegment.status == "indexing"
|
DocumentSegment.status == "indexing"
|
||||||
).update({
|
).update({
|
||||||
@ -751,6 +752,7 @@ class IndexingRunner:
|
|||||||
document_ids = [document.metadata['doc_id'] for document in chunk_documents]
|
document_ids = [document.metadata['doc_id'] for document in chunk_documents]
|
||||||
db.session.query(DocumentSegment).filter(
|
db.session.query(DocumentSegment).filter(
|
||||||
DocumentSegment.document_id == dataset_document.id,
|
DocumentSegment.document_id == dataset_document.id,
|
||||||
|
DocumentSegment.dataset_id == dataset.id,
|
||||||
DocumentSegment.index_node_id.in_(document_ids),
|
DocumentSegment.index_node_id.in_(document_ids),
|
||||||
DocumentSegment.status == "indexing"
|
DocumentSegment.status == "indexing"
|
||||||
).update({
|
).update({
|
||||||
|
Loading…
Reference in New Issue
Block a user