JanusGraph索引步骤

时间:2018-02-11 16:58:37

标签: gremlin janusgraph

我正在使用janusgraph 0.2版本,我从java应用程序连接,我可以创建索引请任何人检查以下内容:

JanusGraphManagement mgmt = graph.openManagement();
mgmt.makePropertyKey("Name").dataType(String.class).make();
mgmt.commit();
JanusGraphManagement mgmt = graph.openManagement();
PropertyKey nameProp = mgmt.getPropertyKey("Name")
mgmt.buildIndex("nameIndex", Vertex.class).addKey(nameProp).buildCompositeIndex()
mgmt.commit();
ManagementSystem.awaitGraphIndexStatus(graph, "nameIndex").status(SchemaStatus.REGISTERED).call();
mgmt = graph.openManagement();
JanusGraphIndex index = mgmt.getGraphIndex("nameIndex");
mgmt.updateIndex(index, SchemaAction.REINDEX);
mgmt.commit();

控制台输出是:

Key Name has status INSTALLED
Some key(s) on index nameIndex do not currently have status(es) [REGISTERED]: Name=INSTALLED

当我检查索引时,此代码不会从gremlin控制台创建索引:

mgmt.awaitGraphIndexStatus(graph, "nameIndex").call()

结果是:

==>GraphIndexStatusReport[success=false, indexName='nameIndex', targetStatus=[REGISTERED], notConverged={Name=ENABLED}, converged={}, elapsed=PT1M0.097S]

0 个答案:

没有答案