mirror of
https://github.com/Cinnamon/kotaemon.git
synced 2026-02-23 19:49:37 +01:00
fix: file limiting in docstore
This commit is contained in:
@@ -177,7 +177,11 @@ class VectorRetrieval(BaseRetrieval):
|
||||
]
|
||||
elif self.retrieval_mode == "text":
|
||||
query = text.text if isinstance(text, Document) else text
|
||||
docs = self.doc_store.query(query, top_k=top_k_first_round, doc_ids=scope)
|
||||
docs = []
|
||||
if scope:
|
||||
docs = self.doc_store.query(
|
||||
query, top_k=top_k_first_round, doc_ids=scope
|
||||
)
|
||||
result = [RetrievedDocument(**doc.to_dict(), score=-1.0) for doc in docs]
|
||||
elif self.retrieval_mode == "hybrid":
|
||||
# similarity search section
|
||||
@@ -206,9 +210,10 @@ class VectorRetrieval(BaseRetrieval):
|
||||
|
||||
assert self.doc_store is not None
|
||||
query = text.text if isinstance(text, Document) else text
|
||||
ds_docs = self.doc_store.query(
|
||||
query, top_k=top_k_first_round, doc_ids=scope
|
||||
)
|
||||
if scope:
|
||||
ds_docs = self.doc_store.query(
|
||||
query, top_k=top_k_first_round, doc_ids=scope
|
||||
)
|
||||
|
||||
vs_query_thread = threading.Thread(target=query_vectorstore)
|
||||
ds_query_thread = threading.Thread(target=query_docstore)
|
||||
|
||||
Reference in New Issue
Block a user