So that is not the index of your vertex. It is the id of your vertex, and if you asking how can you set that, then the answer is that you can't. Titan sets the Ids internally and they are immutable.
What you can do however, is create your own index so you can do fast lookups. I would recommend starting with simple composite index .
You can create a composite index as follows:
graph = TitanFactory.open('conf.properties');
mgmt = graph.openManagement();
myId = mgmt.makePropertyKey("MY-ID").dataType(String.class).make();
mgmt.buildIndex('byMyID', Vertex.class).addKey(myId).buildCompositeIndex();
mgmt.commit();
The above will create a property called MY-ID
and index it. Which means that any vertex with that property can be looked up quickly.
Side Note: Make sure you are initialising a Titan Graph not a Tinker Graph. Tinker Graphs do not support indexing.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.