Fixes #20748 KnowledgeRetrievalNode return all external documents when reranker disabled even top-k configed (#20762)

This commit is contained in:
Rain Wang 2025-06-18 14:35:12 +08:00 committed by GitHub
parent 6d033d4064
commit 47e0f92c0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -496,6 +496,8 @@ class DatasetRetrieval:
all_documents = self.calculate_keyword_score(query, all_documents, top_k)
elif index_type == "high_quality":
all_documents = self.calculate_vector_score(all_documents, top_k, score_threshold)
else:
all_documents = all_documents[:top_k] if top_k else all_documents
self._on_query(query, dataset_ids, app_id, user_from, user_id)