try
{
RelationshipIndex index = service.index().forRelationships( "exact" );
// ...creation of the nodes and relationship
Node node1 = service.createNode();
Node node2 = service.createNode();
String a_uuid = "xyz";
Relationship relationship = node1.createRelationshipTo( node2, DynamicRelationshipType.withName( "related" ) );
index.add( relationship, "uuid", a_uuid );
// query
IndexHits<Relationship> hits = index.get( "uuid", a_uuid, node1, node2 );