Orient db:无法创建索引

时间:2016-08-23 09:35:28

标签: grails indexing orientdb graph-databases tinkerpop

我试图使用带有grails的orient db通过tinkerpop api创建索引时出现以下错误:

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)myindex

为什么图表db中有两个索引?

由于

0 个答案:

没有答案