首页 > 解决方案 > 从 JanusGraph 中检索 indexOnly

问题描述

在 JanusGraph 中,我们可以indexOnly(<label>)像这样指定复合索引:

mgmt.buildIndex("myindex", Vertex.class).addKey(...).indexOnly(<label>).buildCompositeIndex()

在检索复合索引时,我们如何知道它是否是特定标签的索引?我没有看到任何可用于检索此信息的方法:

JanusGraphIndex index = mgmt.getGraphIndex("myindex")

// How to retrieve indexOnly details?

谢谢,

标签: javajanusgraph

解决方案


好消息,这在即将发布的 JanusGraph v0.6.0 版本中得到了修复(已经在https://github.com/JanusGraph/janusgraph/releases/tag/v0.6.0上作为预发布版本提供)。

参见 mgmt.getIndexOnlyConstraint(indexName) 方法: https ://github.com/JanusGraph/janusgraph/blob/v0.6.0/janusgraph-core/src/main/java/org/janusgraph/core/schema/JanusGraphManagement.java


推荐阅读