Co-authored-by: weifj <“weifj@tuyuansu.com.cn”>tags/0.6.15
| @@ -111,7 +111,8 @@ class ChromaVector(BaseVector): | |||
| metadata=metadata, | |||
| ) | |||
| docs.append(doc) | |||
| # Sort the documents by score in descending order | |||
| docs = sorted(docs, key=lambda x: x.metadata['score'], reverse=True) | |||
| return docs | |||
| def search_by_full_text(self, query: str, **kwargs: Any) -> list[Document]: | |||
| @@ -362,6 +362,8 @@ class QdrantVector(BaseVector): | |||
| metadata=metadata, | |||
| ) | |||
| docs.append(doc) | |||
| # Sort the documents by score in descending order | |||
| docs = sorted(docs, key=lambda x: x.metadata['score'], reverse=True) | |||
| return docs | |||
| def search_by_full_text(self, query: str, **kwargs: Any) -> list[Document]: | |||
| @@ -216,7 +216,8 @@ class WeaviateVector(BaseVector): | |||
| if score > score_threshold: | |||
| doc.metadata['score'] = score | |||
| docs.append(doc) | |||
| # Sort the documents by score in descending order | |||
| docs = sorted(docs, key=lambda x: x.metadata['score'], reverse=True) | |||
| return docs | |||
| def search_by_full_text(self, query: str, **kwargs: Any) -> list[Document]: | |||