1

I am using janusgraph 0.2 version and i am connecting from java application, I can create an index please can any one check the following:

JanusGraphManagement mgmt = graph.openManagement();
mgmt.makePropertyKey("Name").dataType(String.class).make();
mgmt.commit();
JanusGraphManagement mgmt = graph.openManagement();
PropertyKey nameProp = mgmt.getPropertyKey("Name")
mgmt.buildIndex("nameIndex", Vertex.class).addKey(nameProp).buildCompositeIndex()
mgmt.commit();
ManagementSystem.awaitGraphIndexStatus(graph, "nameIndex").status(SchemaStatus.REGISTERED).call();
mgmt = graph.openManagement();
JanusGraphIndex index = mgmt.getGraphIndex("nameIndex");
mgmt.updateIndex(index, SchemaAction.REINDEX);
mgmt.commit();

console output is:

Key Name has status INSTALLED
Some key(s) on index nameIndex do not currently have status(es) [REGISTERED]: Name=INSTALLED

This code doesn't create an index from gremlin console when I check that index:

mgmt.awaitGraphIndexStatus(graph, "nameIndex").call()

the result is:

==>GraphIndexStatusReport[success=false, indexName='nameIndex', targetStatus=[REGISTERED], notConverged={Name=ENABLED}, converged={}, elapsed=PT1M0.097S]
janus graph
  • 407
  • 1
  • 3
  • 18
  • Your example is confusing. You create a property key `Name`, then later fetch the property key `FamilyName`. You create an index `nameIndex`, but then the output says `byFamilyNameComposite`, and the last result says `byFirstNameComposite `. It would be helpful if you clean up your example with a single property key and a single composite index. – Jason Plurad Feb 11 '18 at 17:39
  • I fix it. I replace the variable by their value so I didn't notice. hope this will be better. I want know how to get index status and how to go from installed to registered to enabled. – janus graph Feb 11 '18 at 18:27
  • Refer to this thread https://stackoverflow.com/questions/40585417/titan-db-ignoring-index/40591478#40591478 – Jason Plurad Feb 11 '18 at 19:00
  • See also https://github.com/JanusGraph/janusgraph/wiki/Indexing – Jason Plurad Feb 11 '18 at 19:09

0 Answers0