Indexing in thunderdome

45 views
Skip to first unread message

Alexandre Vallette

unread,
May 7, 2013, 4:56:44 AM5/7/13
to thunderd...@googlegroups.com
hello,

I have troubles figuring out how/when should I define my index using thunderdome.

I run titan over cassandra and my search backend is elastic search.

after I connect to the database with
   thunderdome.connection.setup(['localhost'], 'graph')

I start creating Vertices like this:

class VertexPoi(thunderdome.Vertex):
    gremlin_path = 'vertexpoi.groovy'
    get_by_name = thunderdome.GremlinMethod(classmethod = True)

    name = thunderdome.Text()
    tag = thunderdome.Text()
    category = thunderdome.Text()

with :
def get_by_name(name) {
    g.V('name', name).next()
}



but when i query the graph
with 
desired_node = VertexPoi.get_by_name("whatevever")

I get a 
13/05/07 10:53:15 WARN transaction.StandardTitanTx: Query requires iterating over all vertices [(v[36028797018963994]=360)]. For better performance, use indexes


So where and when should i tell titan that I want "name" to be indexed?
thanks

Jonathan Haddad

unread,
May 8, 2013, 10:46:40 AM5/8/13
to Alexandre Vallette, thunderd...@googlegroups.com
We haven't done any work yet for Titan 0.3, since it's more of a preview than a production grade release.

I assume you're using the default autotyping, which is fine for playing around but for serious development you'd probably want to turn it off and define your types.  

We build out a system for defining types in thunderdome, but right now it's only compatible with Titan 0.2.  You can read up on the spec system here:



--
Jon Haddad
http://www.rustyrazorblade.com
skype: rustyrazorblade

Alexandre Vallette

unread,
May 9, 2013, 7:42:03 AM5/9/13
to thunderd...@googlegroups.com, Alexandre Vallette, j...@jonhaddad.com
ok thanks but for the moment thunderdome works fine on titan 0.3 (i'm still doing basic stuff)

i solved my indexing issue with:
thunderdome.connection.execute_query("g.makeType().name('the_key_i_wanted').dataType(Integer.class).indexed(Vertex.class).unique(Direction.BOTH).makePropertyKey()")

Alexandre Vallette

unread,
May 9, 2013, 3:39:18 PM5/9/13
to thunderd...@googlegroups.com, Alexandre Vallette, j...@jonhaddad.com
I also wanted to know if spec-files are the only place where you can define that an edge is bidirectional or unidirected?

Anyway, did I thank you for this great module?

Blake Eggleston

unread,
May 9, 2013, 4:22:03 PM5/9/13
to thunderd...@googlegroups.com
Hi Alexandre,

The main place where the current version of thunderdome will be incompatible with Titan 0.3 is with the property specs. Everything else should be ok (in theory at least). Regarding defining edge behavior , thunderdome does not support that even with 0.2.x at the moment. However I've opened a ticket here:
Reply all
Reply to author
Forward
0 new messages