neo4j - Returning multiple nodes in cypher with Index lookup -
i have following cypher query being called multiple times.
start n=node:myindex(name="abc") return n
then somewhere else in code
start m=node:myindex(name="xyz") return m
my data base hosted in azure , having latency/performance issues. in order speed process, , reduce multiple round trips, thought combining multiple cypher queries single one.
actually, getting 10+ nodes in lookup simplicity have decided show example 2 nodes below.
start n=node:myindex(name="abc"), m=node:myindex(name="xyz") return n, m
my goal can in 1 round trip instead of 10+. works if index lookup on all nodes succeeds. however, cypher query returns 0 rows if one index lookup fails. hoping null equivalent in n or m on missing node. however, no luck.
please suggest doing wrong , workarounds reduce round trips. many thanks!
you can use parametrized query lucene syntax, e.g.:
start n=node:myindex({query}) return n
and parametrize
{'query':'name:(abc xyz)'}
where list of names string space separated names looking for.
Comments
Post a Comment