Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: document word_count appear negative (#27313)

zlyszx92c81b1833a4
diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py
index c430fba0b97..36b38b7b453 100644
--- a/api/core/indexing_runner.py
+++ b/api/core/indexing_runner.py
@@ -415,7 +415,6 @@ class IndexingRunner:
document_id=dataset_document.id,
after_indexing_status="splitting",
extra_update_params={
- DatasetDocument.word_count: sum(len(text_doc.page_content) for text_doc in text_docs),
DatasetDocument.parsing_completed_at: naive_utc_now(),
},
)
@@ -755,6 +754,7 @@ class IndexingRunner:
extra_update_params={
DatasetDocument.cleaning_completed_at: cur_time,
DatasetDocument.splitting_completed_at: cur_time,
+ DatasetDocument.word_count: sum(len(doc.page_content) for doc in documents),
},
)