In my project, I am trying to do a distributed search sorted by some field using solr. The test code is as follows:
SolrQuery query = new SolrQuery(); query.set("q", "id:[1 TO *]"); query.setSortField("id",SolrQuery.ORDER.asc); query.setParam("shards", "localhost:8983/solr, localhost:7574/solr"); QueryResponse response = server.query(query); I get the following error. It seems that solr doesn't support the sort function while doing the distributed search. Do you have any suggestions to solve this problem, thanks! org.apache.solr.client.solrj.SolrServerException: Error executing query at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:103) at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:115) at test.MainClassTest.searchTest(MainClassTest.java:88) at test.MainClassTest.main(MainClassTest.java:48) Caused by: org.apache.solr.client.solrj.SolrServerException: java.net.ConnectException: Connection refused at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:391) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:183) at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:95) ... 3 more