Hi All,

We are upgrading from solr 3.3 to 4.9. But as in solr 4.9
CommonsHttpSolrServer is not available, so I want to replace it with
HttpSolrServer.

In solr 3.3 we're using the following code:

                CommonsHttpSolrServer server = null;

                if (httpClient == null) {
                        server = new CommonsHttpSolrServer(url);
                        httpClient = server.getHttpClient();
                } else {
                        server = new CommonsHttpSolrServer(url, httpClient);
                }

and httpClient is static.

Now in solr 4.9, I am replacing CommonHttpSolrServer with HttpSolrServer in
same code.

                HttpSolrServer server = null;

                if (httpClient == null) {
                        server = new HttpSolrServer(url);
                        httpClient = server.getHttpClient();
                } else {
                        server = new HttpSolrServer(url, httpClient);
                }

and httpClient is same as previous. But whenever its creating second
connection or say executing else block giving exceptions (i.e. Client was
created outside of HttpSolrServer.)

Please help me fix this.

Thanks in advance.

Regards,
Devraj



--
View this message in context: 
http://lucene.472066.n3.nabble.com/upgrading-CommonsHttpSolrServer-to-HttpSolrServer-tp4164620.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to