Karthick Vijay
Karthick Vijay

Reputation: 41

What is Replacement for HttpSolrServer solrServer = new HttpSolrServer(builder.build().toString());

What is Replacement for

HttpSolrServer solrServer = new HttpSolrServer(builder.build().toString());

Upvotes: 2

Views: 2489

Answers (3)

Santanu Mukherjee
Santanu Mukherjee

Reputation: 11

Use below for Solrj 9.x

SolrClient client = new Http2SolrClient.Builder("http://localhost:8983/solr/Collection1").build()

Upvotes: 1

Divyang Shah
Divyang Shah

Reputation: 1668

This is one solution:

SolrClient solrServer = new HttpSolrClient.Builder(solrLocation).build();

Upvotes: 2

Jens
Jens

Reputation: 69440

As the documentation says:

Deprecated. Use HttpSolrClient

@Deprecated public class HttpSolrServer extends HttpSolrClient

HttpSolrClient solrServer = new HttpSolrClient (builder.build().toString());

Upvotes: 1

Related Questions