You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -604,7 +601,7 @@ The `content` field is a formatted string containing the key information intende
604
601
retriever = VectorCypherRetriever(
605
602
driver,
606
603
index_name=INDEX_NAME,
607
-
retrieval_query="MATCH (node)<-[:ACTED_IN]-(p:Person) RETURN node.title as movieTitle, node.plot as movieDescription, collect(p.name) as actors, score",
604
+
retrieval_query="OPTIONAL MATCH (node)<-[:ACTED_IN]-(p:Person) RETURN node.title as movieTitle, node.plot as movieDescription, collect(p.name) as actors, score",
608
605
result_formatter=result_formatter,
609
606
)
610
607
@@ -763,7 +760,7 @@ the graph and return more context:
Copy file name to clipboardExpand all lines: examples/customize/retrievers/result_formatter_vector_cypher_retriever.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,12 @@
21
21
22
22
# for each Movie node matched by the vector search, retrieve more context:
23
23
# the name of all actors starring in that movie
24
-
RETRIEVAL_QUERY=" MATCH (node)<-[:ACTED_IN]-(p:Person) RETURN node.title as movieTitle, node.plot as moviePlot, collect(p.name) as actors, score as similarityScore"
24
+
RETRIEVAL_QUERY="""
25
+
RETURN node.title as movieTitle,
26
+
node.plot as moviePlot,
27
+
collect { MATCH (actor:Actor)-[:ACTED_IN]->(node) RETURN actor.name } AS actors,
Copy file name to clipboardExpand all lines: examples/retrieve/hybrid_cypher_retriever.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,12 @@
22
22
23
23
# for each Movie node matched by the vector search, retrieve more context:
24
24
# the name of all actors starring in that movie
25
-
RETRIEVAL_QUERY=" MATCH (node)<-[:ACTED_IN]-(p:Person) RETURN node.title as movieTitle, node.plot as moviePlot, collect(p.name) as actors, score as similarityScore"
25
+
RETRIEVAL_QUERY="""
26
+
RETURN node.title as movieTitle,
27
+
node.plot as moviePlot,
28
+
collect { MATCH (actor:Actor)-[:ACTED_IN]->(node) RETURN actor.name } AS actors,
Copy file name to clipboardExpand all lines: examples/retrieve/vector_cypher_retriever.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,12 @@
20
20
21
21
# for each Movie node matched by the vector search, retrieve more context:
22
22
# the name of all actors starring in that movie
23
-
RETRIEVAL_QUERY=" MATCH (node)<-[:ACTED_IN]-(p:Person) RETURN node.title as movieTitle, node.plot as moviePlot, collect(p.name) as actors, score as similarityScore"
23
+
RETRIEVAL_QUERY="""
24
+
RETURN node.title as movieTitle,
25
+
node.plot as moviePlot,
26
+
collect { MATCH (actor:Actor)-[:ACTED_IN]->(node) RETURN actor.name } AS actors,
0 commit comments