Hi Stefano,

this cannot work, because the document structure you have under the hood is
this:

(dataset vertex record) --(lives edge record)--> (collection vertex record)

so the out_lives will not contain a collectionid, but one or more record
ids of edges that then point to the collection.

I hope I clarified a little bit the situation.
To do what you want to achieve, the best approach is to retrieve the
collection (using the index, of course) and then browse the incoming
"lives" relationship, but I think you already did it

Luigi


2015-04-14 22:33 GMT+02:00 Stefano Galarraga <[email protected]>:

> Hello,
>
> I'm trying to use the Graph API to retrieve a set of object connected with
> another entity
>
> graph.createEdgeType("lives")
>
> val c = graph.createVertexType("collection")
>
>
> val dataset = graph.createVertexType("dataset")
>
>
> val livesEdge = dataset.createEdgeProperty(Direction.OUT, "lives", 
> OType.LINKBAG).setNotNull(true)
> livesEdge.createIndex(INDEX_TYPE.NOTUNIQUE_HASH_INDEX)
>
>
> When I want to retrieve all the datasets living in a specific collection I'm 
> trying to use the index and do:
>
>
> graph.getVertices("dataset.out_lives", collectionId )
>
>
> This query returns no result.
>
>
> I know I could browse the relationship (this approach works) but I'm actually 
> needing to expand this using a composite index on the collection and another 
> properties and the query on the composite index fails too.
>
>
> I was also hoping the query based on indexes would be faster
>
>
> Thanks
>
>
>  --
>
> ---
> 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.
>

-- 

--- 
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.

Reply via email to