how to index unpublished nodes to apache solr I want to display unpublish nodes to some of the user roles.

The apachesolr by default index only publish nodes.

Is there a way of indexing unpublished nodes to the apache solr index?
By default, with the Search API, it indexes unpublished nodes unless you specify it not to. There is a patch to change the behaviour in the workflow tab of the search api: https://drupal.org/node/1507882

Can you please clarify your setup? Are you using the Search API?