mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
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
|
@ -141,6 +141,16 @@ class WeaviateVectorIndex(BaseVectorIndex):
|
|||
"valueText": document_id
|
||||
})
|
||||
|
||||
def delete_by_group_id(self, group_id: str):
|
||||
if self._is_origin():
|
||||
self.recreate_dataset(self.dataset)
|
||||
return
|
||||
|
||||
vector_store = self._get_vector_store()
|
||||
vector_store = cast(self._get_vector_store_class(), vector_store)
|
||||
|
||||
vector_store.delete()
|
||||
|
||||
def _is_origin(self):
|
||||
if self.dataset.index_struct_dict:
|
||||
class_prefix: str = self.dataset.index_struct_dict['vector_store']['class_prefix']
|
||||
|
|
|
@ -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…
Reference in New Issue
Block a user