In Neo4J 2.x I used auto-indexing of relationships, which then allowed me to do search based on relationship properties that were indexed.
In Neo4J 3.x this doesn't work.
In Neo4J 2.x I'd set in neo4j properties
:
relationship_auto_indexing=true
and set several properties of relationships to be indexed using
relationship_keys_indexable=user,context,statement,gapscan
Then I would use the old 1.x Cypher query to first identify all the relationships made by the user of the type TO
, reading their context property and then matching it to the node that had a specific Context property and then matching the nodes from that context made by that user and retrieving them. The query looked something like
START rel=relationship:relationship_auto_index(user='userid') WHERE TYPE(rel)='TO' WITH DISTINCT rel MATCH (ctx:Context) WHERE rel.context = ctx.uid AND (ctx.name="neo4j3" ) RETURN DISTINCT STARTNODE(rel).uid AS source_id, STARTNODE(rel).name AS source_name, ENDNODE(rel).uid AS target_id, ENDNODE(rel).name AS target_name, rel.uid AS edge_id, ctx.name AS context_name, rel.statement AS statement_id, rel.weight AS weight;
In Neo4J 3.x this query doesn't work and I believe the indexing is done differently.
I have two questions:
1) Do I have to manually index relationship or it is done automatically in 3.x?
2) What query would I use instead of START rel=....
— any alternative to search using relationship properties?