ShiftLeftSecurity / tinkergraph-gremlin

Apache License 2.0
38 stars 12 forks source link

indexes only work if added *after* loading the data #4

Closed mpollmeier closed 5 years ago

mpollmeier commented 6 years ago

the below works, but fails if we swap loading and index creation. check for both vertices and edges.

TinkerGraph graph = TinkerGraph.open(
    Arrays.asList(Song.factory, Artist.factory),
    Arrays.asList(FollowedBy.factory, SungBy.factory, WrittenBy.factory)
);
loadGraphMl(graph);
graph.createIndex("weight", Edge.class);
GraphTraversalSource g = graph.traversal();
long count = g.E().has("weight", P.eq(1)).count().next();
assertEquals(3564, count);