private void generateIndex(final Parameter<Object, Object>... indexParameters) {
this.graph.autoStartTransaction(true);
final IndexManager manager = this.graph.getRawGraph().index();
if (Vertex.class.isAssignableFrom(this.indexClass)) {
if (indexParameters.length > 0)
this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName, generateParameterMap(indexParameters));
else
this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forNodes(this.indexName);
} else {
if (indexParameters.length > 0)
this.rawIndex = (org.neo4j.graphdb.index.Index<S>) manager.forRelationships(this.indexName, generateParameterMap(indexParameters));