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.
On Mar 6, 2014 4:53 PM, <[email protected]> wrote:
> Hi,
>
> Out of curiosity, why are you creating a in/out property for the edge
> manually?
>
> Regards,
> -Stefan
>
> On Thursday, 6 March 2014 16:23:33 UTC, Andrey Yesyev wrote:
>>
>> Okay, looks like everything after OR was excessive.
>> Query works in this shape
>>
>> select from index:relations where key = [ :target, :src ]
>>
>> Using index, performance improved 10 times.
>> Not bad.
>>
>> On Thursday, March 6, 2014 10:41:55 AM UTC-5, Andrey Yesyev wrote:
>>>
>>> I'll proceed with my search.
>>>
>>> Now, I try to use index for edge, here is how I created it
>>>
>>> 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");
>>>
>>> so, I changed my query to use this index
>>>
>>> select from index:relations where Key = [ :target, :src ] or Key = [
>>> :src, :target ]
>>>
>>> but execution of this query throws an exception
>>>
>>> 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)
>>>
>>> What's wrong with 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
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.