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


hadoopmarc@...
 

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()
==>testval
gremlin> m.buildIndex('byTestVal', Vertex.class).addKey(testval).buildCompositeIndex()
==>byTestVal
gremlin> m.commit()

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

Best wishes,   Marc

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.