问题
If I use the default Lucene index engine, what is the Cypher command to delete an index? and what is the Cypher command to delete an index entry within a specific index?
回答1:
I do not know if your question is out of date because you know use a newer version of Neo4j but in version 2.2.1 there is the possibility to drop an index using Cypher
via
DROP INDEX ON :Label(property)
回答2:
Well, I'm not sure if there's a way to delete an Index
using Cypher
..
But you can do it using Neo4j API
as follows:
for ( String indexName : server.getDatabase().graph.index()
.nodeIndexNames() )
{
try{
server.getDatabase().graph.index()
.forNodes( indexName )
.delete();
} catch(UnsupportedOperationException e) {
// Encountered a read-only index.
}
}
for ( String indexName : server.getDatabase().graph.index()
.relationshipIndexNames() )
{
try {
server.getDatabase().graph.index()
.forRelationships( indexName )
.delete();
} catch(UnsupportedOperationException e) {
// Encountered a read-only index.
}
}
You can have a look here, it may help you..
来源:https://stackoverflow.com/questions/17516809/what-are-the-cypher-commands-to-delete-index-and-index-entry