JanusGraph/janusgraph

Index with label constraint does not work for partitioned labels

Open

#1842 aperta il 10 ott 2019

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Java (1137 fork)batch import
area/indexhelp wantedkind/bug/confirmed

Metriche repository

Star
 (4985 star)
Metriche merge PR
 (Merge medio 3g 18h) (12 PR mergiate in 30 g)

Descrizione

Code to reproduce:

graph = JanusGraphFactory.open("inmemory")
mgmt = graph.openManagement()
l = mgmt.makeVertexLabel('V').partition().make()
p1 = mgmt.makePropertyKey('p').cardinality(Cardinality.SINGLE).dataType(String.class).make()
mgmt.buildIndex("i1", Vertex.class).addKey(p1).indexOnly(l).buildCompositeIndex()
mgmt.commit()
g = graph.traversal()

v1=g.addV("V").property('p','a').next()
g.tx().commit()
g.V().hasLabel('V').has('p', 'a')
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@277bc3a5
gremlin> l = mgmt.makeVertexLabel('V').partition().make()
==>V
gremlin> p1 = mgmt.makePropertyKey('p').cardinality(Cardinality.SINGLE).dataType(String.class).make()
==>p
gremlin> mgmt.buildIndex("i1", Vertex.class).addKey(p1).indexOnly(l).buildCompositeIndex()
==>i1
gremlin> mgmt.commit()
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin> 
gremlin> v1=g.addV("V").property('p','a').next()
==>v[4226]
gremlin> g.tx().commit()
==>null
gremlin> g.V().hasLabel('V').has('p', 'a')
gremlin> 

Related issue #206

Guida contributor