solr - CloudSolrServer : Could not find collection : gettingstarted - Stack Overflow
I'm able to figure out the problem. In fact the cluster/cloud was configure rightly but SolrJ-4.x can't be used with Solr 5.0.0; particularly the Cloud Solr API; besides cloud the other queries using HttpSolrServer were producing the results.
I switched to SolrJ-5.0.0 and modified the snippet as below:
CloudSolrClient cloudSolrClient = new CloudSolrClient("localhost:2181") ; cloudSolrClient.setDefaultCollection("gettingstarted"); SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", id); doc.addField("name", name); cloudSolrClient.add(doc); cloudSolrClient.commit(); The API's are changed/refactored
Read full article from solr - CloudSolrServer : Could not find collection : gettingstarted - Stack Overflow
No comments:
Post a Comment