select from RELATED where in = :target and out = :src
vSrc.getEdges(vTarget, Direction.BOTH, RelationType.RELATED.name())
OrientEdgeType edgeType = graph.createEdgeType(RelationType.RELATED.name());edgeType.createProperty("in", OType.LINK);edgeType.createProperty("out", OType.LINK);edgeType.createIndex("relations", OClass.INDEX_TYPE.UNIQUE, "in", "out");select from index:relations where Key = [ :target, :src ] or Key = [ :src, :target ]
com.orientechnologies.orient.core.exception.OCommandExecutionException: 'Key' field is required for queries against indexes at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInIndex(OCommandExecutorSQLSelect.java:1127) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:358) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:330) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:315) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:57) at com.orientechnologies.orient.core.storage.OStorageEmbedded.executeCommand(OStorageEmbedded.java:96)select from index:relations where key = [ :target, :src ]
Hm, good question. I found a post here, where I saw how the author of that post did, so I just copy/past it. I'll try to do this without it. Or maybe someone from orienttechnologies will comment on it.
--
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/QUUVnVQ9x8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.