I am using Solrcloud with zookeeper setup. but when I try to make query using 
following code snippet I get exception

code:
CloudSolrServer server = new CloudSolrServer("localhost:2181");
   server.setDefaultCollection("gettingstarted");
   server.connect();
   SolrQuery query = new SolrQuery();
   query.setQuery(q);
   QueryResponse rsp;
   rsp = server.query(query);

Exception:
Exception in thread "main" org.apache.solr.common.SolrException: Collection not 
found: gettingstarted
 at 
org.apache.solr.client.solrj.impl.CloudSolrServer.getCollectionList(CloudSolrServer.java:679)
 at 
org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:562)
 at 
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:91)
 at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
 at Test.testSelectQueryCloudServer(Test.java:243)
 at Test.main(Test.java:357)

I’ve verified the collection exists on zookeeper using zkCli and I can query 
using solr admin






Sent from Windows Mail

Reply via email to