0

I loaded a graph into Janusgraph from CSV file. Once the data is loaded, I tried to index the graph using compositeIndex. Once the index is built the status is stuck in INSTALLED status.

mgmt=graph.openManagement()
mgmt.getOpenTransactions().size()
==> 0

I've all the transactions closed .

mgmt.buildIndex("querySpeedUp", Vertex.class).addKey(experimentid).addKey(regionid).addKey(sourcemfield).addKey(zcentroid).addKey(sourcesfield).buildCompositeIndex()
mgmt.awaitGraphIndexStatus(graph, 'fastTraversal').call()

mgmt.commit()

//opened new connection
mgmt = graph.openManagement()
gremlin> propkey = mgmt.getPropertyKey('experimentid')
==>experimentid
gremlin>  byName.getIndexStatus(propkey);
==>INSTALLED
gremlin> mgmt.updateIndex(byName, SchemaAction.REGISTER_INDEX).get()
==>null
gremlin> byName.getIndexStatus(propkey);
==>INSTALLED
gremlin> mgmt.commit()
==>null
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@5f025000
gremlin> byName.getIndexStatus(propkey);
==>INSTALLED
gremlin> mgmt.awaitGraphIndexStatus(graph, 'querySpeedUp').call()
==>GraphIndexStatusReport[success=false, indexName='querySpeedUp', targetStatus=[REGISTERED], notConverged={sourcemfield=INSTALLED, sourcesfield=INSTALLED, regionid=INSTALLED, zcentroid=INSTALLED, experimentid=INSTALLED}, converged={}, elapsed=PT1M0.099S]

I've checked various sources here and here but didn't help

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
tourist
  • 4,165
  • 6
  • 25
  • 47
  • 1
    Did you see this [very similar question](https://stackoverflow.com/q/40585417/6753576)? This is probably the biggest problem users have right now with JanusGraph, see also these [two](https://github.com/JanusGraph/janusgraph/issues/460) [issues](https://github.com/JanusGraph/janusgraph/issues/461). The short version is that JanusGraph needs to reindex all data already present in the graph. In general, I would recommend that you try to always create the schema first, including all indices, and then insert the data with this schema. – Florian Hockmann Jun 26 '18 at 14:57
  • @FlorianHockmann I did see the other SO question. It didn't help, I checked the github issue, it again points to the above mentioned SO post – tourist Jun 26 '18 at 15:09

1 Answers1

1

I know this is an old question, but for others who get stuck with this, I found I had to call graph.tx().commit() after the mgmt.commit() and it fixed it for me.

Andrew G
  • 51
  • 2