//4.Create Index String indexName1 = "ByObjectTypeAndName"; String indexName2 = "ByName"; PropertyKey propertyKey1 = mgmt.getPropertyKey("type_object_type"); PropertyKey propertyKey2 = mgmt.getPropertyKey("type_object_name");
EdgeLabel edgeLabel = mgmt.getEdgeLabel("type_object_type");
mgmt.buildEdgeIndex(edgeLabel,"edgeIndex_name",Direction.OUT,Order.incr,propertyKey2); mgmt.buildIndex(indexName2, Vertex.class).addKey(mgmt.getPropertyKey("name")).unique().buildCompositeIndex(); mgmt.buildIndex(indexName1, Vertex.class).addKey(propertyKey1).addKey(propertyKey2).buildCompositeIndex(); mgmt.commit(); //Wait for the index to become available ManagementSystem.awaitGraphIndexStatus(graph, indexName1).call(); ManagementSystem.awaitGraphIndexStatus(graph, indexName2).call();