I have a solr cloud 4.4 set up with two shards.The shards are in two different machine. I have successfully indexed documents using CloudSolrServer of solr client 4.2.0. However while updating the documents some of the documents are getting updated while others are not getting updated and the exception is "org.apache.solr.common.SolrException: No active slice servicing hash code f02c79de in DocCollection(myindex)={" where "myindex" is the name of my index. The code for updating the documents is as follows:
CloudSolrServer server = new CloudSolrServer("myip:9983");
server.setDefaultCollection("myindex");
List<SolrInputDocument> solrInputDocsList = new ArrayList<SolrInputDocument>();
SolrInputDocument solrInputDoc = new SolrInputDocument();
List<String> servicesList = new ArrayList<String>();
servicesList.add("hockey1");
servicesList.add("blogger1");
Map<String, List<String>> services = new HashMap<String, List<String>>();
services.put("set", servicesList);
solrInputDoc.addField("services",services);
solrInputDoc.addField("id",id);
solrInputDocsList.add(solrInputDoc);
server.add(solrInputDocsList);
server.commit();
My Question are: 1) When document are indexed how it is decides which document goes to which shard. 2) Why the update for some of the documents are failing.