Reindexing using the Mgmt System

Hi all! we have an internal debate on how to best perform a reindex, after adding a new index.

On JanusGraph 0.6, which of those options is preferred? and why?

mgmt.buildIndex('IDX_NAME', Vertex.class).addKey(key1, Mapping.STRING.asParameter()).addKey(key2, Mapping.TEXTSTRING.asParameter()).addKey(key3).buildMixedIndex("search")
mgmt.commit()

ManagementSystem.awaitGraphIndexStatus(graph, 'IDX_NAME').status(SchemaStatus.REGISTERED, SchemaStatus.ENABLED).call()
mgmt.updateIndex('IDX_NAME', SchemaAction.REINDEX).get()
mgmt.commit()


vs (this looks more like the examples in the documentation)
mgmt.buildIndex('IDX_NAME', Vertex.class).addKey(key1, Mapping.STRING.asParameter()).addKey(key2, Mapping.TEXTSTRING.asParameter()).addKey(key3).buildMixedIndex("search")
mgmt.commit()

ManagementSystem.awaitGraphIndexStatus(graph, 'IDX_NAME').status(SchemaStatus.REGISTERED).call()
mgmt.updateIndex('IDX_NAME', SchemaAction.REINDEX).get()
mgmt.commit()
ManagementSystem.awaitGraphIndexStatus(graph, 'IDX_NAME').status(SchemaStatus.ENABLED).call()


a followup question - what happens to the index while the index job is running? is it usable? does it transition states?

Thanks!
Was this page helpful?