indexQuery error: Index with name [ ] is unknown or not configured properly


rajdee...@...
 

I am using indexQuery (see code below) and getting the following error:

[error] (run-main-0) java.lang.IllegalArgumentException: Index with name [vertexByText] is unknown or not configured properly
java.lang.IllegalArgumentException: Index with name [vertexByText] is unknown or not configured properly
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at org.janusgraph.graphdb.database.IndexSerializer.getMixedIndex(IndexSerializer.java:692)
at org.janusgraph.graphdb.database.IndexSerializer.executeQuery(IndexSerializer.java:617)
at org.janusgraph.graphdb.query.graph.IndexQueryBuilder.execute(IndexQueryBuilder.java:193)
at org.janusgraph.graphdb.query.graph.IndexQueryBuilder.vertices(IndexQueryBuilder.java:212)
at com.espn.idsvc.test.janusgraph.ExampleIndex$.apply(ExampleIndex.scala:87)
at com.espn.idsvc.test.janusgraph.ExampleIndex$.main(ExampleIndex.scala:108)
at com.espn.idsvc.test.janusgraph.ExampleIndex.main(ExampleIndex.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
[trace] Stack trace suppressed: run last test:run for the full output.



    val factory = JanusGraphFactory.build().set("storage.backend","cassandra").set("storage.hostname","localhost")


    factory
.open()


     val mgmt
= graph.openManagement();
       


      val property_key
= mgmt.getOrCreatePropertyKey(propertyKeyIdentifier)
     


      println
("** Started Indexing now **")


      mgmt
.buildIndex("vertexByText", classOf[Vertex]).addKey(property_key).buildCompositeIndex()
      mgmt
.commit()
      println
("** Finsihed Indexing **")
     
     
// try getting the index
      val retrievedIndex
= mgmt.getGraphIndex("vertexByText")


      graph
.addVertex(propertyKeyIdentifier, "Mass")

     


     
// This does not work for some reason
      val result
= graph.indexQuery(retrievedIndex.name(), "Mass").vertices().iterator()

What is causing it to fail even when the ,getGraphIndex  is able to retrieve the index?


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