This repository was archived by the owner on Oct 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/content/docs/extensions Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -329,10 +329,11 @@ result = conn.execute(
329329 'open-ai', 'text-embedding-3-small',
330330 384
331331 ),
332- 2
332+ $limit
333333 )
334334 RETURN node.title ORDER BY distance;
335- """ )
335+ """ ,
336+ {" limit" : 2 })
336337
337338print (result.get_as_pl())
338339```
@@ -364,9 +365,9 @@ result = conn.execute(
364365 MATCH (n)-[:PublishedBy]->(p:Publisher)
365366 RETURN p.name AS publisher, n.title AS book, distance
366367 ORDER BY distance
367- LIMIT 5 ;
368+ LIMIT $limit ;
368369 """ ,
369- {" query_vector" : query_vector})
370+ {" query_vector" : query_vector, " limit " : 2 })
370371print (result.get_as_pl())
371372```
372373The above query asks for the 2 nearest neighbors of the query vector "quantum machine learning".
@@ -440,7 +441,7 @@ result = conn.execute("""
440441 'filtered_book',
441442 'book_title_index',
442443 $query_vector,
443- 2
444+ $limit
444445 )
445446 WITH node AS n, distance as dist
446447 MATCH (n)-[:PublishedBy]->(p:Publisher)
@@ -449,7 +450,7 @@ result = conn.execute("""
449450 p.name AS publisher
450451 ORDER BY dist;
451452 """ ,
452- {" query_vector" : query_vector})
453+ {" query_vector" : query_vector, " limit " : 2 })
453454print (result.get_as_pl())
454455```
455456</TabItem >
You can’t perform that action at this time.
0 commit comments