You seem to be missing adding the the "document" to the "server":
...
SolrInputDocument doc1 = new SolrInputDocument();
doc1.addField( "id", 23);
doc1.addField( "title", "doc1" );
doc1.addField( "author","Chetan Bhagat" );
doc1.addField( "contents", "I am the best." );
doc1.addField( "date_modified", "12-12-2014" );
server.add(doc1); // **MISSING LINE!!**
server.commit();
...
This is probably the reason why you are not seeing the document in the Solr index. This is an example of "adding document" to Solr: http://www.solrtutorial.com/solrj-tutorial.html
HTH.