community[patch]: the syntax error for Redis generated query (#17717)

To fix the reported error:
https://github.com/langchain-ai/langchain/discussions/17397
This commit is contained in:
sarahberenji
2024-03-01 21:18:10 +01:00
committed by William Fu-Hinthorn
parent a670daf109
commit 5808d27c5d

View File

@@ -1118,7 +1118,7 @@ class Redis(VectorStore):
base_query = f"@{vector_key}:[VECTOR_RANGE $distance_threshold $vector]"
if filter:
base_query = "(" + base_query + " " + str(filter) + ")"
base_query = str(filter) + " " + base_query
query_string = base_query + "=>{$yield_distance_as: distance}"