janusgraph-控制台操作命令

当顶点数量过多时(我的230w)删除太慢

就用下面的命令, 删除整个图库

graph.close()
JanusGraphFactory.drop(graph)

查询所有的顶点属性

用traversal查所有点的属性节点很多的时候会查的很慢的

用management

mgmt= graph.openManagement()
mgmt.getRelationTypes(PropertyKey)
mgmt.commit()

通过控制台添加定点,添加标签

mgmt=graph.openManagement();
mgmt.makeVertexLabel('ALLFALV').make()
mgmt.commit()
//添加标签
mgmt.makePropertyKey('labels').dataType(String.class).cardinality(Cardinality.SINGLE).make()

 添加索引

mgmt = graph.openManagement()
vlabel = mgmt.getPropertyKey('vlabel')
mgmt.buildIndex('mixedvlabel',Vertex.class).addKey(vlabel).buildMixedIndex("search")
mgmt.commit()

查看索引状态

mgmt = graph.openManagement();
vlabel = mgmt.getPropertyKey('vlabel');
mixedvlabel=mgmt.getGraphIndex('mixedvlabel');
status=mixedvlabel.getIndexStatus(vlabel)

猜你喜欢

转载自www.cnblogs.com/learndata/p/10621759.html
今日推荐