Creation of Index on a Relationship

Hi, I am trying to run a Index creation query.
the query is
CREATE INDEX ON RELATIONSHIP :transfer_to (transaction_date).
seems this query is not getting executed.
I would request if anyone can help me to understand how I shall approach to create an index for a relationship.

It should be something like this (in neo4j version 5):

create index my_rel_index if not exists 
    for ()-[r:transfer_to]-() 
    on (r.transaction_date)

Sorry, i forgot mention that i am still using neo4j v3.5

it throws and error like

Neo.ClientError.Statement.SyntaxError: Invalid input 'e': expected 't/T' (line 1, column 16 (offset: 15))
"create index Oper if not exists "

Relationship indexes were introduced during the neo4j 4.3 if I am not mistaken. Time to upgrade :wink:

If you have something specific holding you back from upgrading all the way to the lates release, start new threads? Or, if you are contracted with support and everything, reach out to us for further help.

but in see that when i query Call db.index, i see there are indexes created for relationship with type= relationship_fulltext.

can you please let me know if we can create any index with type relationship_fulltext in v3.5?

Hi @hakan.lofqvist1
I have found out the below query which is creating full text indexs on relationships in v3.5.8

CALL db.index.fulltext.createRelationshipIndex("index_name",["relationshipname"],["relationship property"]).

can you suggest me a idea how i can delete duplicate relationships depending on the id property of that relationship using the fulltext index?

For nodes, I use this based on the database ID() being an incrementing integer:
MATCH (n1:MyLabel), (n2:MyLabel)
WHERE n1.id = n2.id AND ID(n2) > ID(n1)
DETACH DELETE n2

I haven't tried for relationships but the same idea should hold.