fix only full text search in app issue (#1736)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
79b4366203
commit
8c451eb0e6
3 changed files with 14 additions and 2 deletions
|
|
@ -82,7 +82,8 @@ class DatasetMultiRetrieverTool(BaseTool):
|
|||
hit_callback.on_tool_end(all_documents)
|
||||
document_score_list = {}
|
||||
for item in all_documents:
|
||||
document_score_list[item.metadata['doc_id']] = item.metadata['score']
|
||||
if 'score' in item.metadata and item.metadata['score']:
|
||||
document_score_list[item.metadata['doc_id']] = item.metadata['score']
|
||||
|
||||
document_context_list = []
|
||||
index_node_ids = [document.metadata['doc_id'] for document in all_documents]
|
||||
|
|
|
|||
|
|
@ -158,7 +158,8 @@ class DatasetRetrieverTool(BaseTool):
|
|||
document_score_list = {}
|
||||
if dataset.indexing_technique != "economy":
|
||||
for item in documents:
|
||||
document_score_list[item.metadata['doc_id']] = item.metadata['score']
|
||||
if 'score' in item.metadata and item.metadata['score']:
|
||||
document_score_list[item.metadata['doc_id']] = item.metadata['score']
|
||||
document_context_list = []
|
||||
index_node_ids = [document.metadata['doc_id'] for document in documents]
|
||||
segments = DocumentSegment.query.filter(DocumentSegment.dataset_id == self.dataset_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue