Re: Composite Indexing not working as expected for property on vertex in janusgraph 0.6.1


Hi Nikita,

Indeed, the janusgraph query optimizer can not handle the has("newid",unfold().is("hash data")) construct in the right way and the index does not trigger. But then, this construct is not necessary. Even if the "newid" property has a LIST cardinality, you can still do:
g.V().has("newid", "hash data").valueMap(true).tryNext().isPresent() and have the index on newid triggered.

Indeed, your example gremlin> g.V().has("newid","xyz").valueMap(true).tryNext().isPresent() should result in true. I checked it on a fresh database and it does. So, please check the steps you took to get your result.

gremlin> testval = m.makePropertyKey('testval').dataType(String.class).cardinality(Cardinality.LIST).make()
gremlin> m.buildIndex('byTestVal', Vertex.class).addKey(testval).buildCompositeIndex()
gremlin> m.commit()

gremlin> g.addV().property('testval', 'xyz1')
gremlin> g.V(8192).property('testval', 'xyz2')
gremlin> g.V(8192).values('testval')
gremlin> g.V().has("testval","xyz1").valueMap(true).tryNext().isPresent()

Best wishes,   Marc

Join to automatically receive all group messages.