cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create index on Relationship property

I read somewhere that Neo4j latest version supports indexing on relationship properties.

Can someone guide me how can we create index on relationship property?
please share syntax of it and limitations

1 ACCEPTED SOLUTION

Neo4j currently support Full Text Index on Relationships types and properties.

db.index.fulltext.createRelationshipIndex

Please refer -

View solution in original post

7 REPLIES 7

Neo4j currently support Full Text Index on Relationships types and properties.

db.index.fulltext.createRelationshipIndex

Please refer -

If i created index on relationship property, will queries use those indexes implicitly?

I have query like below where querying is done on relationship property.

optional match (u)-[r:Relationship]-() where r.id = 123
 	return u

How can this be optimised with full index search or any other way?

any answers on this?

clem
Graph Steward

Try experimenting with the query with and without the index.

Then, use the PROFILE or EXPLAIN commands to see if the index helps or hurts.

My guess is that it would help.

I need to query index relationship directly to use it. thankx

CALL db.index.fulltext.createRelationshipIndex("Rel_index_name", ["Relationship_Name"], ["Relationship_Property_Name"])

CALL db.index.fulltext.queryRelationships("Rel_index_name", "<search value>") YIELD relationship,score

Hi @rajeevprasanna ,

Neo4j 4.3 has now released with Index on Relationship properties.

Refer -> Indexes for search performance - Neo4j Cypher Manual

A simple demo -> Neo4j 4.3 Relationship Index – Dominic KUMAR's blog