public void createIndex(String label,String propertyName){
  Objects.requireNonNull(label,"label cannot be null");
  Objects.requireNonNull(propertyName,"propertyName cannot be null");
  Neo4JSession session=currentSession();
  transaction.readWrite();
  session.executeStatement(new Statement("CREATE INDEX ON :`" + label + "`("+ propertyName+ ")"));
}

public void createIndex ( String label , String propertyName ) { Objects . requireNonNull ( label , "label cannot be null" ) ; Objects . requireNonNull ( propertyName , "propertyName cannot be null" ) ; Neo4JSession session = currentSession ( ) ; transaction . readWrite ( ) ; session . executeStatement ( new Statement ( "CREATE INDEX ON :`" + label + "`(" + propertyName + ")" ) ) ; }
creates an index in the neo4j database .
