Neo4j's schema index doesn't currently support indexed relationship properties.
While there is a way to leverage the older lucene explicit index to create an index of relationship properties, it's entirely manual, so it's up to you to update the index whenever relationships of the given type are added or removed or the properties changed.
We instead recommend refactoring your model. If you need to perform an index lookup of something, that usually suggests that thing would be better modeled as a node. As a node you are able to create the indexes and constraints you need for quick lookup.
At the very least, merchant_id suggests you should have a :Merchant node in your graph with a unique id.
Hello,
This topic is from a year ago. I was wondering if indexing on relationship properties is something that is on the backlog and is actively being considered as a feature?
As of Neo4j 3.5 we have fulltext schema indexes, which can be applied on relationships. These are implemented via procedure calls, and for relationships you can specify the relationship types you want to index, and the properties of the relationships to be included in the index. These are limited to strings at this point in time.
You can then query the fulltext schema index by the name you used when the index was created, and you'd get back results as well as the score of the result (which you can filter on to get rid of inaccurate results). This is a case insensitive index lookup, and you can additionally use lucene analyzers to have more custom behavior.
Just checking if there are any updates on this? I'm running some analysis queries that filter based on numerical and date properties of a relationship. Is there a way to index these?
No, not currently. We would advise refactoring your model such that nodes have the relevant numerical or date properties, and add an index on them instead.