Problem with graph traversal

30 views
Skip to first unread message

kusha pande

unread,
Mar 26, 2015, 1:12:00 AM3/26/15
to aureliu...@googlegroups.com
Hi 

I am trying to retriev only indexed vertices in the graph

I used the below query

Iterator<Vertex> vertices = titanTransaction.query().has("name").vertices().iterator();

This query traverses to the complete graph and fetches the result, Can anyone suggest me a better way,  The name vertex is indexed.

Thanks

Daniel Kuppitz

unread,
Mar 26, 2015, 7:16:11 AM3/26/15
to aureliu...@googlegroups.com
If it's indexed in ES, you can do something like this:

g.indexQuery("vertexByName", "v.name:*").vertices()

If it's just a normal Titan index, then this won't be possible.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/8767478e-8197-4828-a0ad-2848ddff8b27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kusha pande

unread,
Mar 26, 2015, 8:26:29 AM3/26/15
to aureliu...@googlegroups.com
It is not indexed in ES, Is there no other way ??

Kevin Miller

unread,
Mar 28, 2015, 2:10:10 PM3/28/15
to aureliu...@googlegroups.com
We accomplish this by setting a vertex_type property on all of our vertices and have an index on that key. 

We then query by doing:

g.V('vertex_type',0).toList()

or something like

g.V('vertex_type',0).out('item_belongs_to_list')
Reply all
Reply to author
Forward
0 new messages