索引状态已安装。如何将状态更改为已注册,然后禁用,以将其删除?
GraphTraversalSource g = janusGraph.traversal();
JanusGraphManagement janusGraphManagement = janusGraph.openManagement();
JanusGraphIndex phoneIndex = janusGraphManagement.getGraphIndex("phoneIndex");
PropertyKey phone = janusGraphManagement.getPropertyKey("phone");
SchemaStatus indexStatus = phoneIndex.getIndexStatus(phone);
String name = phoneIndex.name();
System.out.println(name);
if (indexStatus == INSTALLED) {
janusGraphManagement.commit();
janusGraph.tx().commit();
}
Run Code Online (Sandbox Code Playgroud)
