Find starting points through legacy indexes.
| Important The |
In Cypher, every query describes a pattern, and in that pattern one can have multiple starting points.
A starting point is a relationship or a node where a pattern is anchored.
Using START you can only introduce starting points by legacy index seeks.
Note that trying to use a legacy index that doesn’t exist will generate an error.
This is the graph the examples are using:
Get node or relationship from index
Node by index seek
When the starting point can be found by using index seeks, it can be done like this: node:index-name(key = "value"). In this example, there exists a node index named nodes.
Query
START n=node:nodes(name = "A") RETURN n
The query returns the node indexed with the name "A".
Result
| n |
|---|
| 1 row |
|
Relationship by index seek
When the starting point can be found by using index seeks, it can be done like this: relationship:index-name(key = "value").
Query
START r=relationship:rels(name = "Andrés") RETURN r
The relationship indexed with the name property set to "Andrés" is returned by the query.
Result
| r |
|---|
| 1 row |
|
Node by index query
When the starting point can be found by more complex Lucene queries, this is the syntax to use: node:index-name("query").This allows you to write more advanced index queries.
Query
START n=node:nodes("name:A")
RETURN n
The node indexed with name "A" is returned by the query.
Result
| n |
|---|
| 1 row |
|