mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 19:12:42 +00:00
community[pathch]: Add missing custom content_key handling in Redis vector store (#27736)
This fix an error caused by missing custom content_key handling in Redis vector store in function similarity_search_with_score.
This commit is contained in:
@@ -866,7 +866,8 @@ class Redis(VectorStore):
|
||||
metadata = {"id": result.id}
|
||||
metadata.update(self._collect_metadata(result))
|
||||
|
||||
doc = Document(page_content=result.content, metadata=metadata)
|
||||
content_key = self._schema.content_key
|
||||
doc = Document(page_content=getattr(result, content_key), metadata=metadata)
|
||||
distance = self._calculate_fp_distance(result.distance)
|
||||
docs_with_scores.append((doc, distance))
|
||||
|
||||
|
Reference in New Issue
Block a user