Re: how can i remove the index


David Pitera <piter...@...>
 

Your propertyKey `phone` on your index `phoneIndex` is in the `INSTALLED` state, so you need to `REGISTER` it and wait for it to become registered before you can attempt to `enable` it. After it is enabled, you can disable and then remove it.

Some code that should help cause it goes through the whole installed/registered/enabled phase is:




On Thu, Jul 20, 2017 at 11:43 PM, 李平 <lipin...@...> wrote:
public class GraphTest {

public static void main(String[] args) throws Exception {

BaseConfiguration baseConfiguration = new BaseConfiguration();
baseConfiguration.setProperty("storage.backend", "hbase");
baseConfiguration.setProperty("storage.hostname", "192.168.1.108");
baseConfiguration.setProperty("gremlin.graph", "org.janusgraph.core.JanusGraphFactory");
JanusGraph janusGraph = JanusGraphFactory.open(baseConfiguration);
GraphTraversalSource g = janusGraph.traversal();
g.tx().rollback();
JanusGraphManagement janusGraphManagement = janusGraph.openManagement();
JanusGraphIndex phoneIndex = janusGraphManagement.getGraphIndex("phoneIndex");
janusGraphManagement.updateIndex(phoneIndex, SchemaAction.DISABLE_INDEX).get();
janusGraphManagement.commit();
g.tx().commit();
ManagementSystem.awaitGraphIndexStatus(janusGraph,"phoneIndex")
.status(SchemaStatus.DISABLED)
.timeout(10, ChronoUnit.MINUTES)
.call();
janusGraphManagement.updateIndex(phoneIndex, SchemaAction.REMOVE_INDEX).get();
janusGraphManagement.commit();
janusGraph.tx().commit();
System.out.println("---------------------remove index sucess...");

the log is :Some key(s) on index phoneIndex do not currently have status DISABLED: phone=INSTALLED


--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.