【发布时间】:2016-08-23 09:35:28
【问题描述】:
您好,我在尝试通过 tinkerpop api 使用带有 grails 的 orient db 创建索引时遇到以下错误:
com.orientechnologies.orient.core.index.OIndexException:名称为 __@recordmap@___idx-myindex 的索引已存在。
我有一个方法,我首先调用它来删除索引:
Index<Vertex> theIndex = graph.getIndex(indexName, Vertex.class)
if (!theIndex) { // The index is always null when searching for idx-myindex
log.warn "Index ${indexName} does not appear to exist"
return
}
graph.dropIndex(indexName)
commitTransaction()
然后是我调用的方法来创建索引:
Index<Vertex> theIndex = graph.getIndex(indexName, Vertex.class)
if (theIndex) { //index is always null when searching for idx-myindex
log.warn "Index ${indexName} already exists"
return
}
graph.createIndex(indexName, Vertex.class) //throws the error
commitTransaction()
我使用的是orient db 2.1.16,这个问题是从1.6.6升级到现在才出现的。
当我在嵌入图表中列出索引时,我可以看到有两个索引
1) __@recordmap@___myindex
2) 我的索引
为什么图db中有两个索引?
谢谢
【问题讨论】:
标签: grails indexing orientdb graph-databases tinkerpop