Cannot drop index

33 views
Skip to first unread message

Matthew Rooney

unread,
Aug 23, 2016, 10:57:21 AM8/23/16
to OrientDB

Hi im getting the following error when trying to create an index using orient db with grails via tinkerpop api:

com.orientechnologies.orient.core.index.OIndexException: Index with name __@recordmap@___idx-myindex already exists.

I have a method which I call first to drop the indexes:

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

And then a method which I call after to create the index:

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

Im using orient db 2.1.16, and this problem is only arising now after upgrading from 1.6.6.

Also when i list the indexes in the embedded graph I can see there are two indexes

1) __@recordmap@___myindex

2) myindex

Why are there two indexes in the graph db?

Thanks

user.w...@gmail.com

unread,
Aug 24, 2016, 6:21:15 PM8/24/16
to OrientDB
Hi Matthew,

The class, in which you're trying to create and then drop the index, how did you created it? I mean did you created it via tinkerpop or Studio or something else? One more thing, if you can, could post the code of the creation of the class?

Thx in advance.

Regards,
Michela
Reply all
Reply to author
Forward
0 new messages