Re: Lucene index long overflow


hadoopmarc@...
 
Edited

I am not sure what the trouble is in your approach. Using variable names key and label might be problematic (it is in the Gremlin Console). Rather than building out your example, I chose to rework the GraphOfTheGodsFactory with a Long property index for use in the console. See below, this provides you with a working playground (tested on JanusGraph-0.5.3).




graph = JanusGraphFactory.open('conf/janusgraph-berkeleyje-lucene.properties')


management = graph.openManagement();
name = management.makePropertyKey("name").dataType(String.class).make();
nameIndex = management.buildIndex("name", Vertex.class).addKey(name).unique().buildCompositeIndex();
management.setConsistency(nameIndex, ConsistencyModifier.LOCK);
age = management.makePropertyKey("age").dataType(Long.class).make();
management.buildIndex("vertices", Vertex.class).addKey(age).buildMixedIndex("search");

time = management.makePropertyKey("time").dataType(Integer.class).make();
reason = management.makePropertyKey("reason").dataType(String.class).make();
place = management.makePropertyKey("place").dataType(Geoshape.class).make();
management.buildIndex("edges", Edge.class).addKey(reason).addKey(place).buildMixedIndex("search");

management.makeEdgeLabel("father").multiplicity(Multiplicity.MANY2ONE).make();
management.makeEdgeLabel("mother").multiplicity(Multiplicity.MANY2ONE).make();
battled = management.makeEdgeLabel("battled").signature(time).make();
management.buildEdgeIndex(battled, "battlesByTime", Direction.BOTH, Order.desc, time);
management.makeEdgeLabel("lives").signature(reason).make();
management.makeEdgeLabel("pet").make();
management.makeEdgeLabel("brother").make();

management.makeVertexLabel("titan").make();
management.makeVertexLabel("location").make();
management.makeVertexLabel("god").make();
management.makeVertexLabel("demigod").make();
management.makeVertexLabel("human").make();
management.makeVertexLabel("monster").make();

management.commit();

tx = graph.newTransaction();
// vertices

saturn = tx.addVertex(T.label, "titan", "name", "saturn", "age", 10000);
sky = tx.addVertex(T.label, "location", "name", "sky");
sea = tx.addVertex(T.label, "location", "name", "sea");
jupiter = tx.addVertex(T.label, "god", "name", "jupiter", "age", 5000);
neptune = tx.addVertex(T.label, "god", "name", "neptune", "age", 4500);
hercules = tx.addVertex(T.label, "demigod", "name", "hercules", "age", 30);
alcmene = tx.addVertex(T.label, "human", "name", "alcmene", "age", 45);
pluto = tx.addVertex(T.label, "god", "name", "pluto", "age", 4000);
nemean = tx.addVertex(T.label, "monster", "name", "nemean");
hydra = tx.addVertex(T.label, "monster", "name", "hydra");
cerberus = tx.addVertex(T.label, "monster", "name", "cerberus");
tartarus = tx.addVertex(T.label, "location", "name", "tartarus");

// edges

jupiter.addEdge("father", saturn);
jupiter.addEdge("lives", sky, "reason", "loves fresh breezes");
jupiter.addEdge("brother", neptune);
jupiter.addEdge("brother", pluto);

neptune.addEdge("lives", sea).property("reason", "loves waves");
neptune.addEdge("brother", jupiter);
neptune.addEdge("brother", pluto);

hercules.addEdge("father", jupiter);
hercules.addEdge("mother", alcmene);
hercules.addEdge("battled", nemean, "time", 1, "place", Geoshape.point(38.1f, 23.7f));
hercules.addEdge("battled", hydra, "time", 2, "place", Geoshape.point(37.7f, 23.9f));
hercules.addEdge("battled", cerberus, "time", 12, "place", Geoshape.point(39f, 22f));

pluto.addEdge("brother", jupiter);
pluto.addEdge("brother", neptune);
pluto.addEdge("lives", tartarus, "reason", "no fear of death");
pluto.addEdge("pet", cerberus);

cerberus.addEdge("lives", tartarus);

// commit the transaction to disk
tx.commit();

g = graph.traversal()
g.V().has("age", P.lt(9223372036854775807L))

gremlin> g.V().has("age", P.lt(9223372036854775807L))
==>v[4264]
==>v[12536]
==>v[8344]
==>v[8440]
==>v[8272]
==>v[4344]

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