Neo4J Cypher 中的几个参数 apoc.index.relationships
Several arguments apoc.index.relationships in Neo4J Cypher
我目前有一个请求:
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9')
YIELD rel, start, end
有谁知道如何搜索多个 context
值,例如:
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee')
YIELD rel, start, end
apoc.index.relationships
有可能吗?
更新
一种可能的方法是使用 UNION CALL
类似
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9')
YIELD rel, start, end
UNION CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee')
YIELD rel, start, end
这产生了很好的效果。但我想知道是否有一种更优雅的方法可以使请求更短?
谢谢!
你可以使用lucene语法:
context:15229100-b20e-11e3-80d3-6150cb20a1b9 OR context:15229100-b20e-11e3-80d3-6150cb20a1b9
甚至使用数组:
context:(15229100-b20e-11e3-80d3-6150cb20a1b9 15229100-b20e-11e3-80d3-6150cb20a1b9)
我目前有一个请求:
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9')
YIELD rel, start, end
有谁知道如何搜索多个 context
值,例如:
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee')
YIELD rel, start, end
apoc.index.relationships
有可能吗?
更新
一种可能的方法是使用 UNION CALL
类似
CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9')
YIELD rel, start, end
UNION CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9,context:a0328202-d98a-492e-92ae-1010cb829a8ee')
YIELD rel, start, end
这产生了很好的效果。但我想知道是否有一种更优雅的方法可以使请求更短?
谢谢!
你可以使用lucene语法:
context:15229100-b20e-11e3-80d3-6150cb20a1b9 OR context:15229100-b20e-11e3-80d3-6150cb20a1b9
甚至使用数组:
context:(15229100-b20e-11e3-80d3-6150cb20a1b9 15229100-b20e-11e3-80d3-6150cb20a1b9)